Mad Pod Racing - Puzzle Discussion

did you get the answer ? i’m still stuck int the same level

Hey, I am stuck in bronze league and I don’t know how to proceed from here so can anyone help me how can I solve this.

Hey, I am stuck in bronze league and I don’t know how to proceed from here so can anyone help me in this how to solve this and go to next.

hello !
excellent exercice and fun!
starting bronze league atm, and i d like to have some advice and what not comparisons on other code of the same league, i m quite a bit lost atm :smiley:
i ve created distance with opponent wich is not used in this code ( i d like to add it to the boost usage in future in the meaning to skip bouncing with opponent )
let xyb = 1;

let thrust = ’ 100’;

let ligneDroite = false;

let oldCheckpointDist = 0;

let oldCheckpointAngle = 0;

// 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]);

let distOpp = Math.sqrt(Math.abs(x-opponentX)^2*(y-opponentY)^2);

if (oldCheckpointDist > 2000 && nextCheckpointDist > 2000 && nextCheckpointAngle < 30 && oldCheckpointAngle < 30){

    ligneDroite = true;

} else {

    ligneDroite = false;

}



if (ligneDroite === true && xyb >= 1){

    thrust = ' BOOST';

    xyb = xyb -1;

} else if (nextCheckpointDist < oldCheckpointDist){

    if (nextCheckpointDist >= 2000){

        thrust = ' 100';

    }else {

        thrust = ' 80';

    }

} else if (nextCheckpointDist >= oldCheckpointDist && Math.abs(nextCheckpointAngle) >= 100){

    thrust = ' 10';

} else if (nextCheckpointDist >= oldCheckpointDist && Math.abs(nextCheckpointAngle) <= 30){

    thrust = ' 100';

} else if (nextCheckpointDist >= oldCheckpointDist && Math.abs(nextCheckpointAngle) > 30 && Math.abs(nextCheckpointAngle) < 100){

    thrust = ' 30';

}



console.log(nextCheckpointX + ' ' + nextCheckpointY + thrust);

oldCheckpointDist = nextCheckpointDist;

oldCheckpointAngle = nextCheckpointAngle;

}

ANY TIP AND ADVICE MORE THAN WELCOME :wink:

hello. I wanted to try mad pods racing but have no idea what I’m supposed to do. it says it requires thrust or power or something. can someone explain a bit? would appreciate. thanks

Go full speed at all times unless the checkpoint is not in front of you
Aim for the next checkpoint before you hit the current one; you should skid through the checkpoints instead of going into them and then turning (hint: your current speed is useful for figuring out when to start turning)
Remember the position of each checkpoint on the first lap, so you can predict better on the later ones
Ignore collisions; you can get all the way to Gold by just racing efficiently

3 Likes

hey, i’m new in this game and i have some questions.
i have made some tests like

if (next_checkpoint_dist <= 1000 && next_checkpoint_dist > 800)
thrust *= 0.5;

but my speed never change why ?
the next checkpoint dist have an update only when i pass a checkpoint ?

i have to make a counter for use boost only one time, but it start at the beginning at the course…
how i can make to have my boost only after the first checkpoint per exemple ?

at the start the pod will advance toward the position of the next checkpoint.
u need to adjust the speed of the pod, via a variable, like thrust that u can modify with conditions.
for exemple
if nextCheckpointDist > 2000 then thrust = ’ 100’ ( this value is in percent)

and then at the end of u re console.log, u put that variable

2 Likes

i m not yet skilled enough to use skids, have any ressource bout that to tip me ? :smiley:

edit : now i understood what u said about stocking checkpoint id value for 2 nd lap

You may add some code to check what values your variables hold during code execution. For example in JavaScript, the code is like this:
console.error('Debug messages... ' + variable_name_here);

Using the same technique you may also check whether your “if” condition is fulfilled or not. If the condition is never fulfilled, the code within the “if” block will never be executed (and hence nothing is output to the error stream).

Also make sure you include the updated thrust (instead of e.g. a constant value of 100) in your output.

Regarding the question on counter: you may do something like this:

counter = 0;
while (true) {
    if (some_condition && counter == 0) {
        do something;
        counter = 1;
    }
}

This will ensure that when a condition is fulfilled, the actions of that “if” block will execute once only.

I don’t get it. I tried to put different constant values of thrust to see it moving at least to the first point but nothing happened it just shows a message about the pod not reaching anything. maybe I can read somewhere about how it works or it’s obvious and I’m too dumb for all this stuff. it seems to be interesting but I don’t know how to get started. thanks for the response tho

Maybe you can copy and paste the whole error message here?

I tried this puzzle, but I don’t know how to close the popups at the beginning, so I can’t read the instrctions.

The popups will be gone once you have followed all the instructions in the tutorial successfully. Are you stuck at any particular instruction?

I should repair the code, but I haven’t the data of the game, how moves the pod, for example. The popup masks me the rest of the screen.

I saw, I don’t need to understand, just see the error and repair it. :slightly_smiling_face:

1 Like

I have been promoted to Bronze, and I don’t know why. I don’t understand how it works, I just change very few of the code, and now i don’t change nothing more, sometimes I win, sometimes no, and I haven’t the faintest idea what I"m supposed to do to reach silver!

You may read here for some explanation on how bot programming games work:
https://www.codingame.com/forum/t/how-is-the-rank-for-single-finished-bot-programming-computed/194147

For strategies to advance in Mad Pod Racing, you may read the “External Resources” on its front page for a start.

How can I remember each checkpoint can you explain in some algorithmic way.
And please also explain this point also “you should skid through the checkpoints instead of going into them and then turning (hint: your current speed is useful for figuring out when to start turning)”.

Yesterday evening, I was about 38000/39000, I went sleeping, this morning I’m 3165/39000. And no, I didn’t code during my sleep, the code is what it was yesterday.