[chuck-users] random seed
signal.automatique at gmail.com
Sat Sep 11 11:58:23 EDT 2010
I'm not Stephan, but I'm still a bit confused as well so I thought I'd
Std.srand(1200); //set your seed
<<<"--------------", "we always get the same numbers" >>>;
That's what we'd expect, yes.
> Hope this helps!
> Well.... no, not really.
What happens if you don't set the seed with srand(), do you still get the
same numbers? As I understand things now you should get exactly what you are
looking for by simply not setting the seed in line 1. Could you verify that
by not setting the seed at all you get different numbers each time you run
your program? If not we have a bug. I seem to remember there was a issue
like that on Windows, which might be caused by Windows (last time I looked)
not having the "storage" of OS-event based random numbers that Unix
typically uses; that might be the cause. That's no excuse though; as we are
not trying to secure nuclear missiles (I hope!) something like the time in
ms should yield a perfectly serviceable seed at VM startup.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the chuck-users