[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Eric Hodel

11/28/2006 6:47:00 PM

On Nov 28, 2006, at 0951 , Smgspices@aol.com wrote:

> 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.

--
Eric Hodel - drbrain@segment7.net - http://blog.se...
This implementation is HODEL-HASH-9600 compliant

http://trackmap.rob...



2 Answers

Visitor Q

11/17/2010 5:21:00 PM

0

I had a Centaur with LEDs that I installed in it, check out my
following YouTube videos.

http://www.youtube.com/watch?v=s...

http://www.youtube.com/watch?v=F...

I thought the game looked great with them and there was no ghosting
with the lights. I did get a little bit of motion blur playing it
thought sometimes. =]

Any case, go for it!

Hope this helps. =]

Jay

11/17/2010 5:22:00 PM

0

I had a Centaur with LEDs that I installed in it, check out my
following YouTube videos.

http://www.youtube.com/watch?v=s...

http://www.youtube.com/watch?v=F...

I thought the game looked great with them and there was no ghosting
with the lights. I did get a little bit of motion blur playing it
thought sometimes. =]

Any case, go for it!

Hope this helps. =]