Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- **/
- class Player {
- public static void main(String args[]) {
- Scanner in = new Scanner(System.in);
- // game loop
- while (true) {
- int x = in.nextInt();
- int y = in.nextInt();
- int nextCheckpointX = in.nextInt(); // x position of the next check point
- int nextCheckpointY = in.nextInt(); // y position of the next check point
- int nextCheckpointDist = in.nextInt(); // distance to the next checkpoint
- int nextCheckpointAngle = in.nextInt(); // angle between your pod orientation and the direction of the next checkpoint
- int opponentX = in.nextInt();
- int opponentY = in.nextInt();
- String mode = "";
- // Write an action using System.out.println()
- // To debug: System.err.println("Debug messages...");
- // You have to output the target position
- // followed by the power (0 <= thrust <= 100)
- // i.e.: "x y thrust"
- System.err.println("Distance: " + nextCheckpointDist);
- System.err.println("Angle: " + nextCheckpointAngle);
- if(nextCheckpointAngle > 90 || nextCheckpointAngle < -90) {
- System.err.println("turning at 90");
- mode = "turning at greater than 90 degrees";
- }
- if((nextCheckpointAngle < 90 && nextCheckpointAngle > 60) || (nextCheckpointAngle > -90 && nextCheckpointAngle < -60)){
- mode = "90-60";
- }
- if((nextCheckpointAngle < 60 && nextCheckpointAngle > 30) || (nextCheckpointAngle > -60 && nextCheckpointAngle < -30)){
- mode = "60-30";
- }
- if((nextCheckpointAngle < 30 && nextCheckpointAngle > 15) || (nextCheckpointAngle > -30 && nextCheckpointAngle < -15)){
- mode = "30-15";
- }
- if((nextCheckpointAngle < 15 && nextCheckpointAngle > 5) || (nextCheckpointAngle > -15 && nextCheckpointAngle < -5)){
- mode = "15-5";
- }
- if(nextCheckpointDist > 6000 && nextCheckpointAngle == 0){
- System.err.println("boost");
- mode = "boosting";
- }
- switch(mode){
- case "turning at greater than 90 degrees" : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 0");
- break;
- case "boosting": System.out.println(nextCheckpointX + " " + nextCheckpointY + " BOOST");
- break;
- case "90-60" : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 80");
- break;
- case "60-30" : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 85");
- break;
- case "30-15" : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 95");
- break;
- case "15-5" : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 99");
- break;
- default : System.out.println(nextCheckpointX + " " + nextCheckpointY + " 100");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement