SillyRand Class Reference

SillyRand is a simple linear random number generator. More...

List of all members.

Static Public Member Functions

static void silly_rand_init (unsigned int seed)
 seed the PRNG seed.
static unsigned int silly_rand ()
 get the next random number.

Static Private Attributes

static unsigned int g_seed
 the actual seed value.


Detailed Description

SillyRand is a simple linear random number generator.

Its main feature is that it is simple, fast and inline It is used in Cube::NovaAnotherpic() for the purpose of selecting the next piece to try fitting in the design structure.


Member Function Documentation

static void SillyRand::silly_rand_init ( unsigned int  seed  )  [inline, static]

seed the PRNG seed.

static unsigned int SillyRand::silly_rand (  )  [inline, static]

get the next random number.

Although taking up an int, the numbers are 16 bits. the higher 16 bits are taken because they provide better randomality.


Member Data Documentation

unsigned int SillyRand::g_seed [static, private]

the actual seed value.


The documentation for this class was generated from the following file: