while true loop
How is the while (true) loop actually broken down? Does robocode executes the code there 1 iteration per turn? Or..?
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
Return to Thread:Talk:Main Page/while true loop/reply.
The timing thing for me is very confusing...
For example, if i want to fire at a certain angle, i have to rotate to it.. by the time i do.. i have another angle... which requires more rotation.. etc..
Same thing for turning the robot and going ahead.. I never know how to correctly time them. (Effectively stuck)
For gun aiming, see Robocode/Game_Physics#Firing_Pitfall. This can cause your aim to be a tick behind. I think most robots don't worry about it. But if you do worry about it, what I do is predict robot positions 1 tick into the future and use that for aiming. It's not exact, but works well enough for me.