Random Number Generator not very random... (OpenInsight Specific)
At 23 JAN 1999 03:05:46PM Duane ALDATA wrote:
I'm having problems with the random number generator. It keeps giving me the same numbers. (Not very random!) I figure my problem is in the initialization of the random number generator, but I can't figure out what I've done wrong. I'm initializing it using the command
now=Time()InitRnd nowIf I check "now", it does change every time I run the program, but the same sequence of random numbers is generated regardless of the value of "now". Am I missing something?
TIA
Duane PekseALDATA Software Mangement Inc.duanep@aldatasoftware.com
At 24 JAN 1999 06:27PM Cameron Revelation wrote:
Duane,
I too ran into similar problems once seeding the random number generator. The following worked well for me:
function InitRnd(void)
common /%InitRnd%/ Cnt
Cnt += 1
initrnd rnd(time() + Cnt)
return
I always got random results thereafter.
Cameron Purdy
Revelation Software