Okay. There's a fundamental disconnect happening here. I'll toss my hat in the ring and see if I can shed some light.
import java.util.*;
import java.io.*;
import java.math.*;
class Player {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int lightX = in.nextInt();
int lightY = in.nextInt();
int initialTX = in.nextInt();
int initialTY = in.nextInt();
while (true) {
int remainingTurns = in.nextInt();
System.err.println("mythor(" + initialTX + "," + initialTY + ")");
System.out.println("SE");
}
}
}
This is the default stub code provided (in Java) for this puzzle, with comments removed, and with your print message added.
Now, this statement is important: Your program is only executed ONCE for each test. It is not executed every time Thor moves.
So, the initialTX
and initialTY
values should not change at all, ever in the above code, because the code never modifies them. Show me which of the above lines of code modifies initialTY
? Answer: none.
If I run this code through the first test, "Straight line" then the stderr
output is:
mythor(5,4)
mythor(5,4)
mythor(5,4)
mythor(5,4)
...
This is exactly as it should be. His initial position at the start of the test was (5, 4). His initial position didn't change just because his current position changed. His initial position will always be the initial position he had at the beginning of the test. Thor's current position is not provided to you. If you care to know what his current position is, you need to write the code to calculate that. It is not, nor should it be, one of the inputs to the puzzle.
Make sense?