2006-01-12 00:34:56 -05:00
|
|
|
USING: help math ;
|
|
|
|
|
|
|
|
HELP: (random-int) "( -- rand )"
|
|
|
|
{ $values { "rand" "an integer between 0 and 2^32-1" } }
|
|
|
|
{ $description "Generates a random 32-bit unsigned integer." } ;
|
|
|
|
|
|
|
|
HELP: random-int "( n -- rand )"
|
|
|
|
{ $values { "rand" "an integer between 0 and n" } }
|
2006-01-23 21:03:22 -05:00
|
|
|
{ $description "Outputs a pseudo-random integer in the interval " { $snippet "[0,n)" } "." }
|
2006-01-12 00:34:56 -05:00
|
|
|
{ $notes "As per the closed interval notation, the end-points are included in the interval." } ;
|