Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2021
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. **
  2. * Auto-generated code below aims at helping you parse
  3. * the standard input according to the problem statement.
  4. **/
  5.  
  6. const laps = parseInt(readline());
  7. const checkpointCount = parseInt(readline());
  8. const tgs = [];
  9. for (let i = 0; i < checkpointCount; i++) {
  10. var inputs = readline().split(' ');
  11. const checkpointX = parseInt(inputs[0]);
  12. const checkpointY = parseInt(inputs[1]);
  13. tgs.push({
  14. x: checkpointX,
  15. y: checkpointY
  16. });
  17. }
  18.  
  19. // game loop
  20. while (true) {
  21. let tx, ty;
  22. let x, y;
  23. let vx, vy;
  24. let tx2, ty2;
  25. let x2, y2;
  26. for (let i = 0; i < 2; i++) {
  27. var inputs = readline().split(' ');
  28. x = parseInt(inputs[0]); // x position of your pod
  29. y = parseInt(inputs[1]); // y position of your pod
  30. vx = parseInt(inputs[2]); // x speed of your pod
  31. vy = parseInt(inputs[3]); // y speed of your pod
  32. const angle = parseInt(inputs[4]); // angle of your pod
  33. const nextCheckPointId = parseInt(inputs[5]); // next check point id of your pod
  34. tx = tgs[nextCheckPointId].x;
  35. ty = tgs[nextCheckPointId].y;
  36. console.error(nextCheckPointId);
  37. }
  38. for (let i = 0; i < 2; i++) {
  39. var inputs = readline().split(' ');
  40. x2 = parseInt(inputs[0]); // x position of the opponent's pod
  41. y2 = parseInt(inputs[1]); // y position of the opponent's pod
  42. const vx2 = parseInt(inputs[2]); // x speed of the opponent's pod
  43. const vy2 = parseInt(inputs[3]); // y speed of the opponent's pod
  44. const angle2 = parseInt(inputs[4]); // angle of the opponent's pod
  45. const nextCheckPointId2 = parseInt(inputs[5]); // next check point id of the opponent's pod
  46. tx2 = tgs[checkpointCount - 1].x;
  47. ty2 = tgs[checkpointCount - 1].y;
  48. }
  49.  
  50. // Write an action using console.log()
  51. // To debug: console.error('Debug messages...');
  52.  
  53.  
  54. // You have to output the target position
  55. // followed by the power (0 <= thrust <= 100)
  56. // i.e.: "x y thrust"
  57. console.log(tx , ' ', ty, ' 100');
  58. console.log('0' , ' ', '0', ' 100');
  59. }
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement