a better way to randomize an event?

Started by
9 comments, last by graveyard filla 20 years, 3 months ago
quote:Original post by dede
I've heard that you shouldn't use rand() for yes / no, since the least significant digits aren't very random.


For boolean true or false, you only need one bit. If the lower bits don't vary very much, or are not very well distributed, then take a higher bit..
Rand() & (1 << n)  


[edited by - BiTwhise on January 13, 2004 7:59:41 PM]

[edited by - BiTwhise on January 13, 2004 8:00:07 PM]

This topic is closed to new replies.

Advertisement