Coders Strike Back - Puzzle Discussion

I see a lot of talk on this forum that you need to use some fancy genetic algorithm, neural network, or similar method to reach the the top position. That might be so, but you can get very far without it. I am now at rank 380 in the Legends League and I have only being doing heuristic code (=basic scripting) based on ideas on what might work and observing bouts and thinking about how my pods should behave differently. I didn’t read any blog posts or get tips on the net. I think I can get even higher in ranking this way, but enough is enough and now I am moving to a new challenge. It was fun for a few weeks, but now it is time for me to move on. The spring challenge 2020 maybe?

1 Like

It says in the rules (maybe only at higher leagues). It says: “The checkpoints are circular, with a radius of 600 units.”

1 Like

I don’t know if it’s only a problem for Coders Strike Back, but when I use the error_log() function, it displays two times the message, which leads to a difference of turn between what’s diplayed using error_log() and echo.
I’m using PHP as language.

But why they told that thrust = BOOST? What does it.mean?

And then the opponent had the boost. How can i use BOOST?

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
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.