up previous next
reseed    --    reseed the pseudo-random number generator

reseed(N: INT): VOID

CoCoA offers a pseudo-random number generator (see random ); however, each time you start CoCoA it will produce the same random values. The procedure reseed puts the pseudo-random number generator into a state determined solely by the given seed value N . This procedure can be used to make CoCoA generate different random values on different runs, e.g. if reseeded with a value which depends on the current time.

/**/  reseed(123);
/**/  random(0,9);
/**/  reseed(1000000*date()+TimeOfDay());   --> time-dependent seed value

See Also