I am having a bit of trouble with this, I think it might be the layout of the code I use, but in python I have this code
`light_x, light_y, initial_tx, initial_ty = [int(i) for i in raw_input().split()]
thorX = initial_tx
thorY = initial_ty
game loop
while 1:
remaining_turns = int(raw_input()) # The remaining amount of turns Thor can move. Do not remove this line.
# Write an action using print
# To debug: print >> sys.stderr, "Debug messages..."
# A single line providing the move to be made: N NE E SE S SW W or NW
if thorX > light_x:
directionX = "W"
else:
directionX = "E"
if thorY > light_y:
directionY = "N"
else:
directionY = "S"
if directionX == "W":
thorX = thorX + 1
else:
thorX = thorX - 1
if directionY == "N":
thorY = thorY + 1
else:
thorY = thorY -1
print directionY + directionX`
Can anyone help me with this? it just makes him go southeast for some reason.
I need to someone update my code, because I don’t know how to write it and how to pass. I pass all three cases but can’t pass ‘optimal angle’…Pls help me. I code in PHP, this is my code:
$dir="" ;