# Arup Guha
# 2/3/2020
# Solution to COP 2930 Spring Pair Program #1: Where am I?

# Starting spot.
x = 0
y = 0
numMoves = 0
print("You are currently at (",x,",",y,").", sep = "")

# Get ending spot.
endX = int(input("What is the x coordinate of your destination?\n"))
endY = int(input("What is the y coordinate of your destination?\n"))

# Keep on going until the end.
while x != endX or y != endY:

    # Get direction and distance of movement.
    direction = input("What direction do you want to move(x/y)?\n")
    distance = int(input("How much do you want to move in that direction?\n"))

    # We move in x.
    if direction == 'x':
        x += distance

    # Or in y.
    else:
        y += distance

    # Update number of moves.
    numMoves += 1
    
    # Update location.
    print("You are now at (",x,",",y,").", sep = "")

# Print final result.
print("Congrats, you got to your destination in",numMoves,"moves.")
