n must be an exact positive integer.
randomreturns an exact integer between zero (inclusive) and n (exclusive). The values returned byrandomare uniformly distributed from 0 to n.The optional argument state must be of the type returned by
(seed->random-state)or(make-random-state). It defaults to the value of the variable*random-state*. This object is used to maintain the state of the pseudo-random-number generator and is altered as a side effect of calls torandom.
Holds a data structure that encodes the internal state of the random-number generator that
randomuses by default. The nature of this data structure is implementation-dependent. It may be printed out and successfully read back in, but may or may not function correctly as a random-number state object in another implementation.
Returns a new copy of argument state. — Function: copy-random-state
Returns a new copy of
*random-state*.
Returns a new object of type suitable for use as the value of the variable
*random-state*or as a second argument torandom. The number or string seed is used to initialize the state. Ifseed->random-stateis called twice with arguments which areequal?, then the returned data structures will beequal?. Callingseed->random-statewith unequal arguments will nearly always return unequal states.
Returns a new object of type suitable for use as the value of the variable
*random-state*or as a second argument torandom. If the optional argument obj is given, it should be a printable Scheme object; the first 50 characters of its printed representation will be used as the seed. Otherwise the value of*random-state*is used as the seed.