Lionello Lunesu wrote:
"Andrei Alexandrescu" <[email protected]> wrote in message
news:[email protected]...
Ok. Let me just note that rand()%max is a lousy method of generating
random numbers between 0 and max-1 and everybody should put that in
the bin with Popular Examples That Should Never Be Used, together with
exponential Fibonacci, linear-space factorial, and bubblesort.
Yes yes, I know I know, but, honestly, when I'm generating noise for
some terrain generation or a random color, or some fuzzy AI behaviour, I
don't care about random periods that much and %max does the job.
Ahhh, so that's why all my enemies in Far Cry 1 and 2 behave so
predictably! :o)
Andrei