Advertisement
Guest User

Untitled

a guest
May 27th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. import java.util.*;
  2. import java.io.*;
  3. import java.math.*;
  4.  
  5. /**
  6. * Auto-generated code below aims at helping you parse
  7. * the standard input according to the problem statement.
  8. **/
  9. class Player {
  10.  
  11. public static void main(String args[]) {
  12. Scanner in = new Scanner(System.in);
  13. int speed = 100;
  14. int boostAvail = 1;
  15. // game loop
  16. while (true) {
  17.  
  18. int x = in.nextInt();
  19. int y = in.nextInt();
  20. int nextCheckpointX = in.nextInt(); // x position of the next check point
  21. int nextCheckpointY = in.nextInt(); // y position of the next check point
  22. int nextCheckpointDist = in.nextInt(); // distance to the next checkpoint
  23. int nextCheckpointAngle = in.nextInt(); // angle between your pod orientation and the direction of the next checkpoint
  24. int opponentX = in.nextInt();
  25. int opponentY = in.nextInt();
  26. if (nextCheckpointAngle > 90 || nextCheckpointAngle < -90){
  27. speed = 30;
  28.  
  29. } else {
  30.  
  31. speed = 100;
  32. if (nextCheckpointDist < 800){
  33. speed = 0;
  34. }
  35. }
  36.  
  37.  
  38. // Write an action using System.out.println()
  39. // To debug: System.err.println("Debug messages...");
  40.  
  41.  
  42. // You have to output the target position
  43. // followed by the power (0 <= thrust <= 100)
  44. // i.e.: "x y thrust"
  45. if (boostAvail == 1){
  46. System.out.println(nextCheckpointX + " " + nextCheckpointY + " BOOST");
  47. boostAvail = 0;
  48. } else {
  49. System.out.println(nextCheckpointX + " " + nextCheckpointY + " " + speed);
  50. }
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement