Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.IO;
  4. using System.Text;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7.  
  8.  
  9. /**
  10. * Auto-generated code below aims at helping you parse
  11. * the standard input according to the problem statement.
  12. **/
  13. class Player
  14. {
  15. static void Main(string[] args)
  16. {
  17. string[] inputs;
  18.  
  19. // game loop
  20. while (true)
  21. {
  22. inputs = Console.ReadLine().Split(' ');
  23. int x = int.Parse(inputs[0]);
  24. int y = int.Parse(inputs[1]);
  25. int nextCheckpointX = int.Parse(inputs[2]); // x position of the next check point
  26. int nextCheckpointY = int.Parse(inputs[3]); // y position of the next check point
  27. int nextCheckpointDist = int.Parse(inputs[4]); // distance to the next checkpoint
  28. int nextCheckpointAngle = int.Parse(inputs[5]); // angle between your pod orientation and the direction of the next checkpoint
  29. inputs = Console.ReadLine().Split(' ');
  30. int opponentX = int.Parse(inputs[0]);
  31. int opponentY = int.Parse(inputs[1]);
  32. int opponentAngle = 0;
  33.  
  34. int thrust = 100;
  35. bool boosted = false;
  36.  
  37. // Write an action using Console.WriteLine()
  38. // To debug: Console.Error.WriteLine("Debug messages...");
  39.  
  40. if(Math.Abs(nextCheckpointAngle) > 45 && nextCheckpointDist < 1200)
  41. thrust = 0;
  42. if(Math.Abs(nextCheckpointAngle) > 90)
  43. thrust = 0;
  44. if(!boosted && nextCheckpointDist > 4500 && Math.Abs(nextCheckpointAngle) < 5){
  45. boosted = true;
  46. thrust = -1;
  47. }
  48. // You have to output the target position
  49. // followed by the power (0 <= thrust <= 100)
  50. // i.e.: "x y thrust"
  51. if(thrust == -1)
  52. Console.WriteLine(nextCheckpointX + " " + nextCheckpointY + " BOOST");
  53. else
  54. Console.WriteLine(nextCheckpointX + " " + nextCheckpointY + " " + thrust);
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement