Good evening!
I have some question about how to complete the easy angle case wisely: I did it with a lot of syso with empirical test each time and that seems not to be the right way to do, is there a wiser way to achieve it?
I’m only asking for hints! I’m here to learn!
Here is my code:
`import java.util.*;
import java.io.*;
import java.math.*;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
* ---
* Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follow your orders.
**/
class Player {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int lightX = in.nextInt(); // the X position of the light of power
int lightY = in.nextInt(); // the Y position of the light of power
int initialTX = in.nextInt(); // Thor's starting X position
int initialTY = in.nextInt(); // Thor's starting Y position
double i=14;
// game loop
while (true) {
int remainingTurns = in.nextInt(); // The remaining amount of turns Thor can move. Do not remove this line.
// Write an action using System.out.println()
// To debug: System.err.println("Debug messages...");
if (lightY==initialTY){
System.out.println("SE"); // A single line providing the move to be made: N NE E SE S SW W or NW
System.out.println("NE");
}
if(lightX==initialTX){
System.out.println("N");
}
if((lightX<initialTX)&&(lightX<initialTX)&&(i>0)){
System.out.println("SW");
System.out.println("SW");
System.out.println("SW");
System.out.println("SW");
System.out.println("SW");
System.out.println("SW");
System.out.println("SW");
System.out.println("SW");
System.out.println("SW");
System.out.println("NW");
System.out.println("NW");
System.out.println("NW");
System.out.println("NW");
System.out.println("NW");
System.out.println("NW");
System.out.println("NW");
System.out.println("NW");
System.out.println("SW");
System.out.println("SW");
System.out.println("SW");
System.out.println("SW");
System.out.println("NW");
System.out.println("SW");
i--;
System.err.println("i: " + i);
}
}
}
}`