Update the coordinates according to the current directions
if ( S [ i ] == ' U ' ) : NEW_LINE INDENT X += 1 NEW_LINE DEDENT elif ( S [ i ] == ' D ' ) : NEW_LINE INDENT X -= 1 NEW_LINE DEDENT elif ( S [ i ] == ' R ' ) : NEW_LINE INDENT Y += 1 NEW_LINE DEDENT else : NEW_LINE INDENT Y -= 1 NEW_LINE DEDENT