Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.IO;
- using System.Text;
- using System.Collections;
- using System.Collections.Generic;
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- class Player
- {
- static void Main(string[] args)
- {
- string[] inputs;
- // game loop
- while (true)
- {
- inputs = Console.ReadLine().Split(' ');
- int x = int.Parse(inputs[0]);
- int y = int.Parse(inputs[1]);
- int nextCheckpointX = int.Parse(inputs[2]); // x position of the next check point
- int nextCheckpointY = int.Parse(inputs[3]); // y position of the next check point
- int nextCheckpointDist = int.Parse(inputs[4]); // distance to the next checkpoint
- int nextCheckpointAngle = int.Parse(inputs[5]); // angle between your pod orientation and the direction of the next checkpoint
- inputs = Console.ReadLine().Split(' ');
- int opponentX = int.Parse(inputs[0]);
- int opponentY = int.Parse(inputs[1]);
- int opponentAngle = 0;
- int thrust = 100;
- bool boosted = false;
- // Write an action using Console.WriteLine()
- // To debug: Console.Error.WriteLine("Debug messages...");
- if(Math.Abs(nextCheckpointAngle) > 45 && nextCheckpointDist < 1200)
- thrust = 0;
- if(Math.Abs(nextCheckpointAngle) > 90)
- thrust = 0;
- if(!boosted && nextCheckpointDist > 4500 && Math.Abs(nextCheckpointAngle) < 5){
- boosted = true;
- thrust = -1;
- }
- // You have to output the target position
- // followed by the power (0 <= thrust <= 100)
- // i.e.: "x y thrust"
- if(thrust == -1)
- Console.WriteLine(nextCheckpointX + " " + nextCheckpointY + " BOOST");
- else
- Console.WriteLine(nextCheckpointX + " " + nextCheckpointY + " " + thrust);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement