I can’t reproduce the issue you’re describing in my IDE or using your code. Could you please PM the code with which you have this problem?
<?php
while (TRUE)
{
// $x: x position of your pod
// $y: y position of your pod
// $nextCheckpointX: x position of the next check point
// $nextCheckpointY: y position of the next check point
// $nextCheckpointDist: donne la distance entre votre pod et le prochain checkpoint
// $nextCheckpointAngle: donne la diff d'angle entre votre pod et le prochain checkpoint
fscanf(STDIN,
"%d %d %d %d %d %d",
$x,
$y,
$nextCheckpointX,
$nextCheckpointY,
$nextCheckpointDist,
$nextCheckpointAngle
);
// To debug: error_log(var_export($var, true)); (equivalent to var_dump)
error_log(var_export("test", true));
echo ($nextCheckpointX . " " . $nextCheckpointY . " 100\n");
}
?>
Here have a screenshot of my debug console: https://i.ibb.co/jRMTzBC/image.png
I’m using Firefox 76.0.1 (64 bits) on Windows 10 Pro N version 1809 - 17763.1158
you forgot to read one line of input (the opponent position). So you output one line every time you read one line. But a turn is two lines of input so every turn, you send 2 commands. So you’re desynchronizing the input from the output
1 Like
Oh yes my bad
Thanks a lot!
1 Like