Coders Strike Back: probably bug in engine


Round 30, my 1st pod is in point (-340, -430)
It targets point (0, 0)
It’s current angle is 232 degrees
Vector from pod position to target has angle 51.67 degrees (calculated as atan(430.0/340.0))
What is “distance” between pod current angle and angle to target?
If pod turns left, “distance” is 232-51.67 = 180.33 degrees
If pod turns right, “distance” is 360-180.33 = 179.67 degrees

Distance to right is smaller. So I expect pod will turn right. But in replay it turns left. It’s angle is 214 on the next move.
Is it bug in engine or I am wrong somewhere?

The CSB engine gives you a rounded angle at the beginning of each turn.

However, it maintains internally a float value for this angle, which you will not know unless you calculate it in parallel.

In your case, it is probable that the internal value was something closer to 231.6 degrees instead of 232.0 degrees. This would explain the direction taken by your pod.

This is one of the many sub-specified things in recent contests :frowning:


Wow thank you!
In the beginning I run some experiments to test if engine stores exact angles, and made some mistake.

After applying your hint I have right position predictions for dozens of moves.
But… In this particular case prediction is still wrong. Now pod angle is 231.64, which is almost same as 51.67+180.
Probably, results differ because I use doubles, while engine uses floats. Anyway, I’m satisified with current precision.

I’m looking forward to see you appear in the legend leaderboard :slight_smile: