Mad Pod Racing - Puzzle Discussion

Thank you both ,i’ve been struggling with this for days! But it was simple at the end

How do I beat boss 2? I don’t understand the new command and I also forgot it.

The “else” statement in my code is causing issues. The game is saying that it expected an identifier and instead saw ‘else’.
/**

  • 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(’ ‘);
var x = parseInt(inputs[0]);
var y = parseInt(inputs[1]);
var nextCheckpointX = parseInt(inputs[2]); // x position of the next check point
var nextCheckpointY = parseInt(inputs[3]); // y position of the next check point
var nextCheckpointDist = parseInt(inputs[4]); // distance to the next checkpoint
var nextCheckpointAngle = parseInt(inputs[5]); // angle between your pod orientation and the direction of the next checkpoint
var inputs = readline().split(’ ');
var opponentX = parseInt(inputs[0]);
var opponentY = parseInt(inputs[1]);

// Write an action using print()
// To debug: printErr('Debug messages...');


// You have to output the target position
// followed by the power (0 <= thrust <= 100)
// i.e.: "x y thrust"
print(nextCheckpointX + ' ' + nextCheckpointY + ' 100');
if (nextCheckpointAngle > 90) or (nextCheckpointAngle < -90) ;{
thrust = 0;
} else; {
thrust = 100;
}

}

Also the end if statement never worked ;-;.

Instead of OR simply use doublepipe operator that is ||

You can calculate speed manually. You must make variables “prevX”,“prevY” in the end of
game loop code. And calculate speed with theese variables and “x”,“y” variables…

1 Like

And you don’t need the ;'s in the if and else lines.

Hello,

How do I use the boost in Wood 1 League? I did an if/then statement, and then put thrust = BOOST;, but it didn’t work.

Thanks,
Coloradohusky

EDIT: Oh, also, I am using Javascript.

I think you just print
BOOST
by itself as the output.

1 Like

I tried it, and it didn’t work. Any other suggestions?

BOOST instead of speed. You still have to give the x and y you’re trying to aim towards.

x y BOOST

I tried that, and it didn’t work. Thanks for trying to help though! Does anyone else know?

Yeah I agree, I climbed all the way from Wood 1 to Gold with the code I’ve written in Wood 1. That’s a huge step to take now and I really have to scrap all my code…

I can help u a little if u ask a question.

What @MrAnderson wrote is the way to do it. Maybe you can explain what exactly didn’t work.

How to BOOST in this game ?
I have try replace value of thrust but it’s fail :disappointed:

You need another else if for this.

Here’a way to go through bronze:
1-get the velocity,ie the present position of the pod substracts the previous position of it by x and y,vx=x-x1,vy=y-y1.
2-by velocity get the next position of the pod,ie x2=x+vx and y2=y+vy.
3-get the mirror point of the next position to the next destitaion.ie xm=2xd-x2,ym=2yd-y2.
4-use xm and ym as the first two input of the print function

as with thrust,you can try:
if angle>=90 or angle<=-90:
thrust=0
else:
thrust=100

good luck

16 Likes

The physics is not properly explained.

7 Likes

Any tips about SHIELD ?

Can i activate SHIELD after BOOST ?
“However, the pod will not be able to accelerate for the next 3 turns” - 3 turns == 3 laps, or what ?

When should i activate SHIELD ? When my X,Y points are the same like my opponent or 400 units radius between our points