Mad Pod Racing - Puzzle Discussion

Normally you print: the x-coordinate of the target, the y-coordinate of the target and a thrust value (between 0 and 100). Example: 7476 1344 90

But one time in the game you can replace the last value by the word “BOOST” to get an acceleration boost. Example: 7476 1344 BOOST

1 Like

When my ship is near the checkpoint I have reduce my thrust to 20. But still my ship goes too far after crossing the checkpoint and before turning back. If I reduce the thrust more, I can’t win. How do I adjust the thrust?

Thank you, my work works and i just got to bronze!

How to use circular force-field?

Set up circular force-field

A weird situation:

If I delete the boss and replace with my own name, I get my own two ships to compete. But one of the ship is way too behind than the other.
Shouldn’t they be flying parallel and both be the winner?

It depends on situation as both pods doesn’t start from same position and some other factors like collision if you are above bronze.

1 Like

I’ve tried to get boost to work but it just won’t and i’ve tried alot even had someone else look over it but he didn’t know what was going wrong either so if anyone could help me?

'if(next_checkpoint_angle > 90):
thrust = 0
else:
thrust = 100

if(next_checkpoint_dist <= 10):
    thrust = "boost"

print(str(x) + " " + str(y) + " " + str(thrust))’

Your code is generally correct. The problem is the if-statement:

A checkpoint has a radius of 600 units. So you can imagine how little 10 is. Just try it with 5000. Then the pods should use the boost. After that you can change the value like you want.

And another thing: You have to print “BOOST” and not “boost”.
I hope I could help you.

1 Like

thank you, it helped alot and it’s now working though i am wondering where does it say the radius?

I am not really sure, because I am in Gold league and there you have a lot of information, you have not in the leagues before. I don’t know in what league you are, but according to the fact that you have tried to get the boost to work, I don’t think you are in Gold or Legend League.
In the description for the gold league is written:
“The checkpoints are circular, with a radius of 600 units.”

It’s possible that this isn’t written in your description.
But if you have again a problem like this, you can to example try to print the next_checkpoint_dist with:

print(next_checkpoint_dist, file=sys.stderr)

for this you need to import sys at the beggining of the program (like already done in the standard code):

import sys

If you use file=sys.stderr, your output is shown for you but you don’t have the problem that it’s taken as the normal output where you have to print x, y and thrust.

Just try it out.

1 Like

thanks it helped but in further trying to optimize it I now encountered a syntax error and i can’t find whats wrong, if someone could help me? The error occurs at the next_checkpoint_angle it says that a bracket is false but i don’t know why.

boosted = “BOOST”

if(boosted == False):

    next_checkpoint_dist <= 5000

    thrust = boosted

elif(boosted == True):

    thrust = 100

else(next_checkpoint_angle > 90):

    thrust = 0

You can’t give a condition for else-statement. I think what you mean is

elif(next_checkpoint_angle > 90):

else means: In every other case
elif means: In every other case where the given condition is True.

that fixed that but now thrust is not defined which is confusing me, I never coded before and really started the day before yesterday, so thanks for your help

I kind of fixed it now and it seems to be working
edit: scratch that it now isn’t boosting anymore.

How can we start over? It has been a long time since I last used this website and specially this game. It’s introducing me new concepts, but I want to start over from scratch.
How do I do that?

Try click the “Restore default code” on the top right corner?

That resets the code on the editor but does not take the game to “Day one” just resets the code with the default example code provided for the current level.
I guess my “solution” would be making a new account and start that challenge until I catch up to where I’m now. But I think they should think on adding a way to reset the whole thing.

Hi,
I started working on it again since I needed to do some Private stuff but now I Realized it isn’t boosting, I’ve now worked on it for several hours and couldn’t get it to work, if anyone could help me would be great, thanks in advance.

thrust = “”

if(thrust == "BOOST" == next_checkpoint_dist <= 5000 == True):

    thrust = "BOOST"

elif(thrust == "BOOST" == next_checkpoint_dist >= 5000 == False):

    thrust = "100"

elif(next_checkpoint_angle > 90):

    thrust = "0"

elif(next_checkpoint_angle < -90):

    thrust = "0"

Hey !
You’re setting thrust to “”, and then test if it’s equal to “BOOST”. The two first conditions will never be true…
Then, I’m not sure to understand what you’re trying to do by putting == everywhere instead of using logical operators (“And”, “Or”,…)…

1 Like