Hello,
I have a code with import time who doesn’t work:
import sys
import math
import time
Auto-generated code below aims at helping you parse
the standard input according to the problem statement.
t0 =0
enVirage = False
#game loop
while True:
# next_checkpoint_x: x position of the next check point
# next_checkpoint_y: y position of the next check point
# next_checkpoint_dist: distance to the next checkpoint
# next_checkpoint_angle: angle between your pod orientation and the direction of the next checkpoint
x, y, next_checkpoint_x, next_checkpoint_y, next_checkpoint_dist, next_checkpoint_angle = [int(i) for i in input().split()]
opponent_x, opponent_y = [int(i) for i in input().split()]
# Write an action using print
# To debug: print("Debug messages...", file=sys.stderr, flush=True)
# You have to output the target position
# followed by the power (0 <= thrust <= 100)
# i.e.: "x y thrust"
if next_checkpoint_dist>1000:
accel = 100
enVirage = False
accel =int(accel - next_checkpoint_angle/3)
elif next_checkpoint_dist<2000:
accel = int(next_checkpoint_dist/2000*100)
accel =int(accel - next_checkpoint_angle/3.5)
enVirage = True
to = int(time.time())
***************** here the while never happens ******************************
Would you please edit your message and format your code properly by using the </> button in the toolbar? We aren’t able to read your code easily in the present state.
I’m in wood 2 league .
i’ve tihs code but he doesn’t work
/**
* 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...');
// You have to output the target position
// followed by the power (0 <= thrust <= 100)
// i.e.: "x y thrust"
console.log(nextCheckpointX + ' ' + nextCheckpointY + '100');
console.log(opponentX + ' ' + opponentY+ '100');
}
I’m in silver league, and can consistently place 1st/2nd but am having issues figuring out where to further refine my code.
Currently I’m using vector steering: my position + (checkpoint position-my next position),
BOOST if more than 5000, and angle to next checkpoint is less than 15 degrees,
Cut power and start turning to centre of map if <2500 of the objective and angle is less than 15 degrees.
It’s working really well, but without the next next checkpoint coordinates, I just can’t figure out where to further refine the code to drive better to get those extra couple of points to beat the boss and advance to gold. Any suggestions?
Have you tried this target: next checkpoint position - current pod’s velocity. Velocity isn’t provided, so you’d have to calculate your own from the positions.
I attempted that, store it in an array.
I’m working in C, it timed out pretty quickly, maybe I need to go back and find a more efficient method of storing and calling the locations.
You can’t go back in league. At best, you can create new account and try not to promote.
There is optimization puzzle search race, with similar physics that can be seen as single-player mad pod racing.
Hi all, is it existing a way to solve the problem offline ? (i mean something like an simulator env.) Thanks !
You can try cg brutaltester with coders strike back (former mad pod racing name) referee.
Have you followed the interactive tutorial when you first start the game? If so, do you think you have fixed the issue in the code as highlighted during the tutorial?