Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

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 now

If 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 Pekse
   ALDATA 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

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/1ea2b2c6978492f985256702006e645b.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1