|
-
April 2nd, 2012, 02:43 PM
#3
Re: Simulation: Tortoise & Hare race (srand question)
 Originally Posted by VladimirF
Read about srand.
If you seed the random number generator with the same value, you get the same sequence.
And for the duration of your program, time(0) likely doesn't change.
That's not the issue, it's when the program terminates, then I relaunch it again... I get maybe 3-4 repeated sequences if I place srand() inside the functions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|