Lionello Lunesu wrote:

"Andrei Alexandrescu" <seewebsiteforem...@erdani.org> wrote in message news:gnafec$1ck...@digitalmars.com...
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

Reply via email to