Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- // game loop
- while (true) {
- var inputs = readline().split(' ');
- const x = parseInt(inputs[0]);
- const y = parseInt(inputs[1]);
- const nextCheckpointX = parseInt(inputs[2]); // x position of the next check point
- const nextCheckpointY = parseInt(inputs[3]); // y position of the next check point
- const nextCheckpointDist = parseInt(inputs[4]); // distance to the next checkpoint
- const nextCheckpointAngle = parseInt(inputs[5]); // angle between your pod orientation and the direction of the next checkpoint
- var inputs = readline().split(' ');
- const opponentX = parseInt(inputs[0]);
- const opponentY = parseInt(inputs[1]);
- // Write an action using console.log()
- // To debug: console.error('Debug messages...');
- var a = Math.sin(nextCheckpointAngle * Math.PI / 180) * nextCheckpointDist;
- var b = Math.cos(nextCheckpointAngle * Math.PI / 180) * nextCheckpointDist;
- // You have to output the target position
- // followed by the power (0 <= thrust <= 100)
- // i.e.: "x y thrust"
- if (nextCheckpointAngle > 90 || nextCheckpointAngle < -90) {
- console.log(nextCheckpointX + ' ' + nextCheckpointY + ' 1');
- } else if (nextCheckpointDist > 9000) {
- while (a + b > nextCheckpointDist) {
- console.log(nextCheckpointX + ' ' + nextCheckpointY + ' 0');
- }
- console.log(nextCheckpointX + ' ' + nextCheckpointY + ' BOOST');
- } else {
- console.log(nextCheckpointX + ' ' + nextCheckpointY + ' 100');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement