delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/02/13:19:49

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Random numbers
Date: Mon, 02 Jun 1997 11:39:08 -0400
Organization: Cornell University
Lines: 13
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <3392E91C.252B@cornell.edu>
References: <01bc6ce9$72076bc0$363e63c3 AT 8652hvt73761> <338F40EE DOT 5244E66 AT alcyone DOT com> <339110F2 DOT 7537 AT nxus DOT com>
Reply-To: asu1 AT cornell DOT edu
NNTP-Posting-Host: 128
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

cjwhite wrote:
> 
> I have been playing around with random numbers for a few days using
> random() % (whatever) but the numbers to not appear to be random. It
> seems to only randomize when i recompile. I can manually enter a new
> seed, but i am using this for a game so i need to have the computer
> generate truly random numbers by itself.
> 
all computer generated random numbers are pseudo-random. you can avoid
the predictability of the sequence by using something like the clock
ticks as the seed.

  -- Sinan

- Raw text -


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