Skip to content

Commit e5e146f

Browse files
committed
[add] Minimal solution for Coders Strike Back
Bronze league
1 parent 8171674 commit e5e146f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
let isStart = true
2+
3+
// game loop
4+
while (true) {
5+
let inputs = readline().split(' ');
6+
const x = parseInt(inputs[0]);
7+
const y = parseInt(inputs[1]);
8+
const nextCheckpointX = parseInt(inputs[2]); // x position of the next check point
9+
const nextCheckpointY = parseInt(inputs[3]); // y position of the next check point
10+
const nextCheckpointDist = parseInt(inputs[4]); // distance to the next checkpoint
11+
const nextCheckpointAngle = parseInt(inputs[5]); // angle between your pod orientation and the direction of the next checkpoint
12+
let input = readline().split(' ');
13+
const opponentX = parseInt(input[0]);
14+
const opponentY = parseInt(input[1]);
15+
16+
let thrust = 100
17+
if (isStart) {
18+
thrust = "BOOST"
19+
}
20+
21+
if (nextCheckpointAngle > 90 || nextCheckpointAngle < -90) {
22+
thrust = 0
23+
}
24+
25+
// You have to output the target position
26+
// followed by the power (0 <= thrust <= 100)
27+
// i.e.: "x y thrust"
28+
print(nextCheckpointX + ' ' + nextCheckpointY + ' ' + thrust + ' ' + thrust);
29+
isStart = false
30+
}

0 commit comments

Comments
 (0)