Main Page   Compound List   File List   Header Files   File Members  

rand.h File Reference

Random generator using the linear congruential method. More...


Functions

void initrand (UINT16 seed)
Initalise the random number generator. More...

INT8 rand (void)
Returns a random value.

UINT16 randw (void)
Returns a random word.

void initarand (UINT16 seed)
Random generator using the linear lagged additive method Note that 'initarand()' calls 'initrand()' with the same seed value, and uses 'rand()' to initialize the random generator. More...

INT8 arand (void)
Generates a random number using the linear lagged additive method.


Detailed Description

Random generator using the linear congruential method.

Author(s):
Luc Van den Borre

Function Documentation

void initrand (UINT16 seed)

Initalise the random number generator.

seed needs to be different each time, else the same sequence will be generated. A good source is the DVI register.

void initarand (UINT16 seed)

Random generator using the linear lagged additive method Note that 'initarand()' calls 'initrand()' with the same seed value, and uses 'rand()' to initialize the random generator.

Author(s):
Luc Van den Borre

Generated at Sun May 7 12:17:00 2000 for gbdk-lib by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999