I am incredibly frustrated by this puzzle.
I declare CurrentTX and CurrentTY int variables before the while statement. I update those variables within each if statement. I have 8 if statements, one for each cardinal direction. I lose on the third challenge when Thor drops off the bottom of the map trying to go SW even though my code for going SW isn’t met because thor’s position is (18,17) and the Light’s position is (0,17) and thus CurrentTY - lightY IS NOT < 0.
else if (CurrentTX - lightX > 0 && CurrentTY - lightY < 0)
At that point he should start going east via this statement:
else if (CurrentTX - lightX > 0 && CurrentTY - lightY == 0)
But instead he keeps going SW. Again, just to be clear, I have variables for his current position and they are updated in the if statements.