Advanced random number generator
It is useful to be able to reset a random-number generator to produce a sequence starting from a given value. Design a new
procedure that is called with an argument that is either the symbol
or the symbol
and behaves as follows:
produces a new random number;
((rand 'reset) <new-value>)
resets the internal state variable to the designated
. Thus, by resetting the state, one can generate repeatable sequences. These are very handy to have when testing and debugging programs that use random numbers.
Nobody's finished this exercise yet. You'll be the first!
There are no comments yet.
You must log in to post a comment.Login