TIP: Click on subject to list as thread! ANSI
echo: nthelp
to: mark.lewis
from: Geo
date: 2004-12-13 19:17:42
subject: Re: c++ help

From: "Geo" 

"Mark.Lewis"  wrote in message
news:b09feb.8c58ba{at}harborwebs.com...

>
> FWIW: this likely doesn't really return as random a seed as you'd like...
back
> when i was doing a lot more coding than i do these days, there was a lot
of
> discussion on setting the random seed several times to achieve "more
random"
> sequences... many tests and a lot of mathematical analysis showed that
what
> actually happened was more predictability rather than more randomness...

The loop wasn't setting the seed, basically the code was just

srand(time(NULL));
 for (int i=1; i<=rand(); i++)

so if you ran thru this once a second the first rand() after the seed would
generate numbers like 650, 654, 657, 660, 665

but by then doing a rand() in the loop and having the loop execute 650 or
654 times you would end up with a much more randome looking value after
that loop because a small initial change would give a much larger change
after the loop.

Geo.

--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270 5030/786
@PATH: 379/45 1 396/45 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.