[Home]GetRoundNum

Robo Home | Changes | Preferences | AllPages

RoboCodeAPI

https://robocode.alphaworks.ibm.com/docs/robocode/robocode/Robot.html#getRoundNum()

...is wrong.

getRoundNum?() returns values from (0 to getNumRounds?()-1)

(Refer to: https://www.alphaworks.ibm.com/forum/robocode.nsf/15f3c8e00254392088256ae400359060/1c9849105a983f220ec781e5792c078a?OpenDocument)

Wow. That really explains a strange bug I had with a division by zero some versions ago. I ended up adding 1 to what I thought was the round number, just to get rid of the problem. Felt a bit bad about such an ugly solution. Now it seems that it was the correct thing to do. =) I hope Mat fixes the bug in the documentation and not in the code. -- PEZ

He had intended to fix the doc... -- Ray Vermette

Oh, is there any way that you can check the total number of rounds in the battle? -- Jokester

getNumRounds?() :-) -- Kawigi


Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited June 17, 2005 1:57 EST by Kawigi (diff)
Search: