cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/30/21:33:16

From: "Trent and Zacc" <Xzzdengla AT dingo DOT cc DOT uq DOT edu DOT au>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie Question: Random Numbers
Date: Sun, 27 Jul 1997 23:34:04 +1000
Organization: University of Queensland
Lines: 21
Message-ID: <5rfinq$fan$1@nargun.cc.uq.edu.au>
References: <01bc9a61$57701640$204678c7 AT warren1>
NNTP-Posting-Host: zzdengla.slip.cc.uq.edu.au
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


Warren Smith wrote in article <01bc9a61$57701640$204678c7 AT warren1>...

>How can I get a truly random number (w/o the same sequence of numbers
>appearing over and over)?
>

Ahh...the billion dolar question...

Simply, you can't AFAIK....

Are you seeding the randomiser?  This starts you at a different point in
the sequence which makes it more difficult to tell that the numbers
are not really entirely random.

If you aren't try using:  srand( time( NULL) )

This will give a fairly good random sequence of numbers.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019