Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 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.  
  14. // game loop
  15. while (true) {
  16. int x = in.nextInt();
  17. int y = in.nextInt();
  18. int nextCheckpointX = in.nextInt(); // x position of the next check point
  19. int nextCheckpointY = in.nextInt(); // y position of the next check point
  20. int nextCheckpointDist = in.nextInt(); // distance to the next checkpoint
  21. int nextCheckpointAngle = in.nextInt(); // angle between your pod orientation and the direction of the next checkpoint
  22. int opponentX = in.nextInt();
  23. int opponentY = in.nextInt();
  24. String mode = "";
  25. // Write an action using System.out.println()
  26. // To debug: System.err.println("Debug messages...");
  27.  
  28.  
  29. // You have to output the target position
  30. // followed by the power (0 <= thrust <= 100)
  31. // i.e.: "x y thrust"
  32. System.err.println("Distance: " + nextCheckpointDist);
  33. System.err.println("Angle: " + nextCheckpointAngle);
  34. if(nextCheckpointAngle > 90 || nextCheckpointAngle < -90) {
  35. System.err.println("turning at 90");
  36. mode = "turning at greater than 90 degrees";
  37. }
  38. if((nextCheckpointAngle < 90 && nextCheckpointAngle > 60) || (nextCheckpointAngle > -90 && nextCheckpointAngle < -60)){
  39. mode = "90-60";
  40. }
  41. if((nextCheckpointAngle < 60 && nextCheckpointAngle > 30) || (nextCheckpointAngle > -60 && nextCheckpointAngle < -30)){
  42. mode = "60-30";
  43. }
  44. if((nextCheckpointAngle < 30 && nextCheckpointAngle > 15) || (nextCheckpointAngle > -30 && nextCheckpointAngle < -15)){
  45. mode = "30-15";
  46. }
  47. if((nextCheckpointAngle < 15 && nextCheckpointAngle > 5) || (nextCheckpointAngle > -15 && nextCheckpointAngle < -5)){
  48. mode = "15-5";
  49. }
  50. if(nextCheckpointDist > 6000 && nextCheckpointAngle == 0){
  51. System.err.println("boost");
  52. mode = "boosting";
  53. }
  54.  
  55.  
  56.  
  57. switch(mode){
  58. case "turning at greater than 90 degrees" : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 0");
  59. break;
  60. case "boosting": System.out.println(nextCheckpointX + " " + nextCheckpointY + " BOOST");
  61. break;
  62. case "90-60" : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 80");
  63. break;
  64. case "60-30" : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 85");
  65. break;
  66. case "30-15" : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 95");
  67. break;
  68. case "15-5" : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 99");
  69. break;
  70. default : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 100");
  71. }
  72.  
  73. }
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement