www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/31/00:03:34

From: Damian Yerrick <DELCAPSyerricde AT pineight DOT 8mSOFTWARE DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: rand and random
Organization: Pin Eight Software <http://yerricde.tripod.com/binaries/>
Message-ID: <p6obOB+BRMP7QeUGn1Z+l2JBPBVt@4ax.com>
References: <s1n73iu5iqi71 AT corp DOT supernews DOT com>
X-Newsreader: Forte Agent 1.6/32.525
MIME-Version: 1.0
Lines: 17
X-Trace: /w3Za/STN6qkazMFk1m4K1xuJzmBFtNZpFARnad/2ZdenwcYz3nADt4gg7bdsXYfDVOmPv85yjTW!1jiJgyaYN66QD1gOCWAGKlBQR3LYaG2YaoY3XIzFDrUPz8BWxw8aDEH2EDkvRnalaw==
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Sun, 31 Oct 1999 03:03:08 GMT
Distribution: world
Date: Sun, 31 Oct 1999 03:03:09 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Sat, 30 Oct 1999 18:30:03 -0700,
"Al Morgan" <muaddib AT proaxis DOT com> wrote:

> How does one use the rand(), and random() functions?

Read the libc docs.

But I know you're busy:

rand() will give a number between 0 and 32,767.
Call srand(time(NULL)) beforehand.
But don't use rand() for AI in video games with prerecorded demos; the
pseudorandom sequence is implementation defined.

--
Damian Yerrick
Visit my web site: http://yerricde.spedia.net/

- Raw text -


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