Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. import sys
  2. import math
  3.  
  4. # Auto-generated code below aims at helping you parse
  5. # the standard input according to the problem statement.
  6. # ---
  7. # Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follow your orders.
  8.  
  9. # light_x: the X position of the light of power
  10. # light_y: the Y position of the light of power
  11. # initial_tx: Thor's starting X position
  12. # initial_ty: Thor's starting Y position
  13. light_x, light_y, initial_tx, initial_ty = [int(i) for i in input().split()]
  14.  
  15. thorx=initial_tx
  16. thory=initial_ty
  17. # game loop
  18. while True:
  19. remaining_turns = int(input()) # The remaining amount of turns Thor can move. Do not remove this line.
  20.  
  21. direction_x=""
  22. direction_y=""
  23.  
  24. if light_x>initial_tx:
  25. direction_x="E"
  26. thorx+=1
  27. else:
  28. direction_x="W"
  29. thorx-=1
  30. if light_y>initial_ty:
  31. direction_y="S"
  32. thory+=1
  33. else:
  34. direction_y="N"
  35. thory-=1
  36. # Write an action using print
  37. # To debug: print("Debug messages...", file=sys.stderr)
  38.  
  39.  
  40. # A single line providing the move to be made: N NE E SE S SW W or NW
  41. print(direction_x)
  42. print(direction_y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement