Randomize Procedure
Call Randomize
once at the start of a program to
start the sequence of pseudorandom numbers at a different number each
time you run the program. Randomize
sets the
RandSeed
variable to a value based on the time of
day. Randomize
is a real procedure.
When testing a program, do not call Randomize
.
That way, you will get the same sequence of pseudorandom numbers
every time you run the program, and you can compare results between
runs. After testing, add the call to Randomize
so
that each time the program runs, it starts the sequence of
pseudorandom numbers differently.
Do not call Randomize
more than once in the same
program. Doing so destroys the randomness of the pseudorandom
numbers.
Randomize
uses the time of day to initialize
RandSeed
. If the program runs at the same time
every day, you should find a different way to initialize
RandSeed
.