Important: The information in this document is obsolete and should not be used for new development.
SetRandomSeed
You can use theSetRandomSeed
function to set the starting number for the random number generator algorithm.
void SetRandomSeed(const wide *seed);
seed
- The pointer to the number to be used by the random number algorithm to generate random numbers.
DESCRIPTION
Random number generators are seeded with a value that is used by the algorithm to generate a random number. The seed is then used to generate the next random number.The
SetRandomSeed
function allows you to select the seed used by the QuickDraw GX random number algorithm. IfSetRandomSeed
is not used, QuickDraw GX will select a default seed of 0. This results in the same sequence of random numbers each timeRandomBits
is called.In order to obtain a different set of random numbers than those obtained using the default seed value or a previously set seed, use the
SetRandomSeed
function.SEE ALSO
TheRandomBits
function uses the current seed to generate the next random number. TheRandomBits
function is described on page 8-58. TheGetRandomSeed
function returns the current seed. TheGetRandomSeed
function is described next.