Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <stdbool.h>
  5.  
  6. /**
  7. * Auto-generated code below aims at helping you parse
  8. * the standard input according to the problem statement.
  9. **/
  10.  
  11. int main()
  12. {
  13.  
  14. // game loop
  15. while (1) {
  16. int x;
  17. int y;
  18. // x position of the next check point
  19. int next_checkpoint_x;
  20. // y position of the next check point
  21. int next_checkpoint_y;
  22. // distance to the next checkpoint
  23. int next_checkpoint_dist;
  24. // angle between your pod orientation and the direction of the next checkpoint
  25. int next_checkpoint_angle;
  26. scanf("%d%d%d%d%d%d", &x, &y, &next_checkpoint_x, &next_checkpoint_y, &next_checkpoint_dist, &next_checkpoint_angle);
  27. int opponent_x;
  28. int opponent_y;
  29. scanf("%d%d", &opponent_x, &opponent_y);
  30.  
  31. // Write an action using printf(). DON'T FORGET THE TRAILING \n
  32. // To debug: fprintf(stderr, "Debug messages...\n");
  33.  
  34.  
  35. // You have to output the target position
  36. // followed by the power (0 <= thrust <= 100)
  37. // i.e.: "x y thrust"
  38. int thrust;
  39. if(next_checkpoint_angle > 90 || next_checkpoint_angle < -90 && next_checkpoint_dist >= 6000)
  40. thrust = 0;
  41. else
  42. thrust = 80;
  43.  
  44. if(next_checkpoint_angle == 0 && next_checkpoint_dist > 4000)
  45. printf("%d %d %d BOOST\n",next_checkpoint_angle, next_checkpoint_x, next_checkpoint_y );
  46. else
  47. printf("%d %d 100\n", next_checkpoint_x, next_checkpoint_y );
  48.  
  49. }
  50.  
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement