🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #4957

Random Numbers

#4957
From: Michael D Mellinger
Date: Fri, 01 Mar 1991 19:57
13 lines
746 bytes
How can I get a random number on on DOS machines?  Seeding the random
# generator with the system clock seemed like a good idea, but not all
machines have clocks.  Here is what I am doing now.

srand( (unsigned int) time(theTime))

Then I successively call rand() to get my random #.

Anyone have a better idea?


-Mike
Technical Details
Message-ID: <r7bGl?wz@cs.psu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!psuvax1!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!psuvax1!news
From: melling@cs.psu.edu (Michael D Mellinger)
Newsgroups: comp.os.msdos.programmer
Subject: Random Numbers
Message-ID: <r7bGl?wz@cs.psu.edu>
Date: 1 Mar 91 19:57:44 GMT
Sender: news@cs.psu.edu (Usenet)
Distribution: comp
Organization: Penn State Computer Science
Lines: 13
Nntp-Posting-Host: sunws5.sys.cs.psu.edu