On Mon, 2003-01-27 at 10:43, kcorey wrote:
> Ouch! Floating point *and* a divide for a random number?
>
> I take the points on board for simulations where maximum entropy
> is the main goal...but for a *game* on a 16 bit (okay, okay, for the
> pedantic a 16/32 bit) CPU that doesn't have a FPU?
>
> Speed has to take priority...
>
I would disagree with this. If he was talking about a fast-paced game
with lots of stuff going on all the time, maybe. But I believe I saw
that it was a dice-based game, which kind of implies that the app
probably spends a good deal of time waiting for user input and probably
has lots of time to kill. The user probably wouldn't notice at all if
some of that wait time was spent generating a valid random number that
met his requirements (all values having equal probability).
Sometimes if an app has slow response, the easiest solution isn't to
optimize the slow part of that code but to just move it to somewhere
else in the time stream.
/dwight
--
Dwight N. Tovey
Email: [EMAIL PROTECTED]
http://www.dtovey.net/dwight
---
Despite the cost of living, have you noticed how popular it remains?
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/