Mail Archives: djgpp/1998/03/24/15:08:48
Nathan Cournia wrote:
> What I need
> is a function that will act as a (n) sided dice. Thanks for the help.
Use
rand()%n + 1
which will give you a random number betwen 1 and n, inclusive.
Note that pseudorandom number generators tend to be poor in their lower
significant bits, so this is sometimes not an ideal solution.
--
Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
Alcyone Systems / http://www.alcyone.com/max/
San Jose, California, United States / icbm:+37.20.07/-121.53.38
\
"I've got the fever for the / flavor of a cracker"
/ Ice Cube
- Raw text -