XP is just a number | |
PerlMonks |
Re: Generating Repeatable Pseudorandom Sequencesby thinker (Parson) |
on Sep 04, 2002 at 18:34 UTC ( [id://195156]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|