POSITION:028,114
COLOUR:STANDARD
TEXT:00,Left on its own, rand() will generate a unpredictable random value every
TEXT:16,time it is called. However, some programs may need to repeat the same
TEXT:16,random values more than once. This is done by setting the random number
TEXT:16,generator's "seed" (a source value where all rand()-generated values are
TEXT:16,drawn from) to a certain value. You can do this by using the library
TEXT:16,routine set_rand():
COLOUR:EUPHORIA
TEXT:32,include machine.e
TEXT:16,set_rand( )
COLOUR:POINTS
TEXT:00,         a
COLOUR:STANDARD
TEXT:32,If you execute set_rand() to set the random number generator seed to  ,
COLOUR:POINTS
TEXT:00,                                                                     a
COLOUR:STANDARD
TEXT:16,execute rand() three times to generate three different random numbers
TEXT:16,(let's pretend we generated 51, 67, and 2), then execute set_rand() again
TEXT:16,using the same value of  , the next three executions of rand() will
COLOUR:POINTS
TEXT:00,                        a
COLOUR:STANDARD
TEXT:16,generate the same values of 51, 67, and 2.

