
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
Ray Dillinger <[EMAIL PROTECTED]> wrote:
:> : It becomes interesting in that case whether the crucial test is a : zero check or a less-than-or-equal-to-zero check. If it's a zero : check you have to figure out exactly how many cats and of what kinds
: you can kill in order to cause the rollover to happen and bring the : Cat Lord's idea of # of cats killed back to zero. It could be quite
: a daunting quest. If it's a less-than-or-equal-to-zero check though, : you'd just need to kill at least X but no more than Y to put the : counter somewhere in the negative range.
So let this be a lesson for all programmers: when counting killed monsters, use unsigned ints (or longs, shorts, chars or whatever, although longer is probably better).
| <-- __Chronological__ --> | <-- __Thread__ --> |