Because unless next_checkpoint_angle is exactly 90 or -90, either the first or the second if-condition is fulfilled before the code can even have a chance to check the last condition regarding next_checkpoint_dist.
thank you 
is this ok?
import sys
import math
Auto-generated code below aims at helping you parse
the standard input according to the problem statement.
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()]
if next_checkpoint_angle > 90 or next_checkpoint_angle < -90:
thrust = 0
print(next_checkpoint_x,next_checkpoint_y,thrust)
if next_checkpoint_dist > 100 :
print(str(next_checkpoint_x) + " " + str(next_checkpoint_y)+" "+ "BOOST")
elif next_checkpoint_angle < 90 and next_checkpoint_angle > -90:
thrust = 100
print(next_checkpoint_x,next_checkpoint_y,thrust)
if next_checkpoint_dist > 100 :
print(str(next_checkpoint_x) + " " + str(next_checkpoint_y)+" "+ "BOOST")
No, because it is possible that you print twice when both the angle condition and the distance condition are fulfilled. Please take some time to study how conditions work.
ok
thank you
Hello, how i can move the pod? I mean what is the line of code to do that?
Hmm…maybe the last one ?
More seriously…the default code (and the last line) is explicit, and normally the statement too.
hey,
So i m new to this puzzle and also quite new to this website. There were neural networks mentioned as part of a possible solution. So i created one and tried making it calculate the outputs for the pod but now my question is how i can i train my net? Is there a way to keep values and to update them for my net to continously learn? Or did i missinterpret the usage of a nn here=?
You may read this thread for more information: https://www.codingame.com/forum/t/neural-network-ressources/1667
hello, i’m in the gold league and my AI wont improve they stay the same ive read many blogs and examples but i can get the right “magic numbers” as explained in tcourreges code in gethub could anyone help?
yes what language of code are you using?
can u privately message me i need help with my AI i am in gold league if anyone can help me i can show you my code but i need help evolving them they just fail worse and worse
Yo guys, i’m actually in Bronze and i’m already stuck. I don’t have any idea about what to do with the opponent x and y, even if I tried to make something for 3 hours. Can someone tell me an idea ? Thank you
Ignore it until gold league. Focus on driving.
Mad Pod Racing. Wood 2 league - Obsolete data
Hi! 
Mad Pod Racing. Wood 2 league - Obsolete data
map=4000 3000 12000 3000 8000 6000
Opponent Boss 2
I really enjoy Mad Pod Racing.
Here is something i don’t understand.
I’m using Java.
Turn 54/168
It Says Lap 1/3 in top left corner.
Checkpoint 0 is lit. On screen the pod body is outside checkpoint 0 area.
Turn 54 debug output:
Position 3993, 3743 ← Y 3743 says pod is outside checkpoint 0 area.
Speed -295, -325 ← Difference in x and y positions from last turn?
Target 4000, 3000 ← This is the x, y position of checkpoint 0.
Turn 54 standard error stream:
pod position 4341 4126 ← This is different from debug output. Old data?
target 4000 3000 ← Target checkpoint 0. Same as debug output.
nextCheckpointDist 1177 ← Correct. But calculated from old data?
nextCheckpointAngle 9 ← Visually this isn’t right. Should probably be 17?
gameLoop 54
Turn 55
Lap 2 starts. Lap 2/3 in top left corner.
Checkpoint 0 light is off and checkpoint 1 light is on.
On screen the pod body is inside checkpoint 0 area.
Target is still checkpoint 0. Both in debug output and in standard output stream.
This move will be towards the wrong target.
Turn 55 debug output:
Position 3699, 3333 ← X, Y says the pod is inside checkpoint 0 area.
Speed -250, -348 ← Should be x -294, y -410?
Target 4000, 3000 ← Obsolete data from turn 54.
Turn 55 Standard error stream:
pod position 3993 3743 ← Obsolete data from turn 54 debug output.
target 4000 3000 ← Obsolete data from turn 54.
nextCheckpointDist 743 ← Obsolete data from turn 54 debug output.
nextCheckpointAngle 17 ← Obsolete data. Should be 87.
gameLoop 55
Turn 56
Both debug output and standard error stream gets new target. 1 turn too late.
Turn 56 Debug output:
Position 3476, 2904 ← debug ouput posisions always seems right
Speed -189, -364 ← I don’t know whats wrong here.
Target 12000, 3000 ← Right values but 1 turn too late.
Turn 56 Standard error stream:
pod position 3699 3333 ← Obsolete. Always 1 turn late.
target 12000 3000 ← Right values but 1 turn late.
nextCheckpointDist 8308 ← Calculated from old data.
nextCheckpointAngle 87 ← Obsolete. Always 1 turn late.
gameLoop 56
Sorry about the indenting. Its this editor or the browser.
Best regards! 
Game code:
import java.util.*;
class Player {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int gameLoop = 1;
// game loop
while (true) {
int x = in.nextInt();
int y = in.nextInt();
int nextCheckpointX = in.nextInt();
int nextCheckpointY = in.nextInt();
int nextCheckpointDist = in.nextInt();
int nextCheckpointAngle = in.nextInt();
int opponentX = in.nextInt();
int opponentY = in.nextInt();
System.err.println("pod position " + x + " " + y);
System.err.println("target " + nextCheckpointX + " " + nextCheckpointY);
System.err.println("nextCheckpointDist " + nextCheckpointDist);
System.err.println("nextCheckpointAngle " + nextCheckpointAngle);
System.err.println("gameLoop " + gameLoop);
gameLoop ++;
System.out.println(nextCheckpointX + " " + nextCheckpointY + " 85");
}
}
}
It’s easier if you can share the replay link and screenshots too. But I’ll give you an explanation using my own replay and see if you can find the same thing.
Your code shows that you are printing to System.err the values of the variables at the beginning of the turn. And you have to refer to the previous frame of the replay to find the same numbers as that shows the state of affairs at the end of the turn.
Screenshots below: the console is printing out the values of the variables at the beginning of turn 11, which are the same as those shown as the state of affairs at the end of turn 10.
Hope it helps!
Hi guys!
A bit like @Slava_Ukraini the speed displayed is not the same as in the sys.err for me. Or i’m wrong ?
velocityX = nextX - currentX
velocityY = nextY - currentY
Nope ? 
Please check if my reply above your post helps. If not, please share the replay link and a screenshot of an example for our reference.
Thank you 5DN1L for you answer. ![]()
I think I understand you.
This post will be only about Wood 2 league and the Debug speed output.
I see in you answer that you are in a higher league and I guess you get more input data.
Maybe even speed.
Also the league you are in, probably have this problem fixed.
I will post screenshots and try to post a replay. I’m not sure how it’s done. ![]()
In Wood 2 league speed in debug output isn’t speed.
This is what i think it is.
Map is map=4000 3000 12000 3000 8000 6000
Replay: Coding Games and Programming Challenges to Code Better
//
//
Turn 1
1 output is done. Saying go to next checkpoint at thrust 88.
Turn 1 Debug output says:
Position: 4088, 2505
Speed: 74 , 4
Target: 12000, 3000
To get to the X position we calculate X speed and add that to the old X position:
Old X speed + thrust - resistance. 0 + 88 - 0 = 88.
Resistance is 0 because we start at X speed 0 and at X speed 0 the resistance is 0.
Old X position is 4000 and to that we add X speed 88. We get X 4088.
Our new X position at the end of turn 1 is 4088.
74 is part of the X speed calculation. But not for this turn.
//
//
Turn 2.
1 output is done. Saying go to next checkpoint at thrust 88.
Turn 2 Debug output says:
Position: 4250, 2514
Speed: 137 , 8
Target: 12000, 3000
xSpeed = oldXSpeed + thrust - resistance = 88 + 88 - 14 = 162
resistance is 14. That’s how 74 is involved. oldSpeed - 74 = 14.
Debug says X speed is 137. It’s not X speed. It’s part on next turns X speed calculation.
X Distance traveled from last turn: 4250 - 4088 = 162.
//
//
Turn 3
1 output is done. Saying go to next checkpoint at thrust 88.
Turn 3 Debug output says:
Position: 4475, 2528
Speed: 191 , 11
Target: 12000, 3000
xSpeed = oldSpeed + thrust - resistance = 162 + 88 - 25 = 225
Resistance is 25.
137 from turn 2 debug output is old speed - resistance = 162 - 25 = 137
X Distance traveled from last turn: 4475 - 4250 = 225.
Code:
I’m sorry about the indenting. I’ll try a different browser next time.
And the code isn’t important.
Only thing happening in code is:
System.out.println(nextCheckpointX + " " + nextCheckpointY + " 88");
Best regards! ![]()
import java.util.*;
class Player {
public static void main(String args[]) {
System.err.println("This is turn 0.");
Scanner in = new Scanner(System.in);
// After System.in turn is 1.
System.err.println("This is turn 1. Before game loop start.");
// int gameLoop is set to 1 to match number of turns.
// Turns will be 0 to 168
int gameLoop = 1;
// game loop
while (true) {
int x = in.nextInt();
int y = in.nextInt();
int nextCheckpointX = in.nextInt();
int nextCheckpointY = in.nextInt();
int nextCheckpointDist = in.nextInt();
int nextCheckpointAngle = in.nextInt();
int opponentX = in.nextInt();
int opponentY = in.nextInt();
System.err.println();
System.err.println("gameLoop " + gameLoop);
System.err.println("pod position " + x + " " + y);
System.err.println("target " + nextCheckpointX + " " + nextCheckpointY);
System.err.println("nextCheckpointDist " + nextCheckpointDist);
System.err.println("nextCheckpointAngle " + nextCheckpointAngle);
System.err.println("opponent position " + opponentX + " " + + opponentY);
gameLoop ++;
System.out.println(nextCheckpointX + " " + nextCheckpointY + " 88");
}
}
}
The game engine applies friction (this is the term used in the statement, equivalent to “resistance” in your message) after the pods have moved, i.e. at the end of every turn. So:
Turn 1:
X speed during current turn = Old X speed + thrust = 0 + 88 = 88
X-coordinate = Old X-coordinate + speed = 4000 + 88 = 4088
X speed at the end of turn = “Old” X speed x 0.85 = 88 x 0.85 = 74
4088 and 74 are shown in turn 1 of the replay.
Turn 2:
X speed during current turn = Old X speed + thrust = 74 + 88 = 162
X-coordinate = Old X-coordinate + speed = 4088 + 162 = 4250
X speed at the end of turn = “Old” X speed x 0.85 = 162 x 0.85 = 137
4250 and 137 are shown in turn 2 in the replay.
Turn 3:
X speed during current turn = Old X speed + thrust = 137 + 88 = 225
X-coordinate = Old X-coordinate + speed = 4250 + 225 = 4475
X speed at the end of turn = “Old” X speed x 0.85 = 225 x 0.85 = 191
4475 and 191 are shown in turn 3 in the replay.
Hope this explanation helps you understand how the game engine works in this game.
If you still have questions on distance and angle as mentioned in your original post, please kindly explain your calculation using this replay too, and I will try to help you understand 
btw, code in this forum should be formatted using the </> button in the formatting toolbar 





