in reply to Generating Repeatable Pseudorandom Sequences
Hi mp,
All you have to do is call srand() with the same value every time. So use a constant, or even a literal, instead of a variable.
So, if your program begins srand(42), it will always return the same sequence of random numbers.
Hope this helps
thinker
All you have to do is call srand() with the same value every time. So use a constant, or even a literal, instead of a variable.
So, if your program begins srand(42), it will always return the same sequence of random numbers.
Hope this helps
thinker
|
---|
In Section
Seekers of Perl Wisdom