Re: rand random. You've got to be kidding

In a message dated 11/28/2006 11:47:44 A.M. US Mountain Standard Tim,
[email protected] writes:

Surely it must be possible to initialize rand with current date and
time.
Documents seem to indicate this is done with rand(0) or srand with
no value. I
have tried both methods and I get the same tired old sequence of
numbers. I
would write my own random number generator except I don’t know how
to get a
numeric value out of Time.

On windows I think there is no way to seed from /dev/urandom, so you
get seeded by some default value. Instead the seed is composed of
the current time in seconds and microseconds and the pid.

It could be that the problem exists because I am running windows. I’d
run it
in Linux except I couldn’t figure out how to get Ruby to work in Linux.
I am
a Linux newby as well as a Ruby newby :-). The problem also might be in
the
file.sort{rand} method.