TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Sean Price
from: Darin McBride
date: 1996-05-15 15:39:20
subject: Random Seed

SP> Hello all!

 SP>         Does anyone have code for a random seed that'll make a program 
 SP> generate a different random number each time it's run?  
 SP> Something that uses a system timer would probably work 
 SP> best.  I wrote a bitmap changer a long time ago and 
 SP> have been cleaning it up and adding some features so I 
 SP> can release it as freeware.  I'm using Watcom v.10.0 
 SP> and the closest thing I could find to what I'm looking 
 SP> for is the clock() function, but this is ticks since 
 SP> the program's start which will be almost identical each 
 SP> time the program  is run.

What are you seeding?  Try using time(NULL), for an example.  For another
example, pilfer SNIP9509.* from some BBS around there that gets the PDNCEE
file echo, as it has a lot of C/C++ code in there, including a few random
number generators and at least one seed generator for the RNG's.


--- Maximus/2 3.01
* Origin: Tanktalus' Tower BBS (PVT) (1:342/708)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 934 955 712/407
SEEN-BY: 712/515 517 628 713/888 800/1
@PATH: 342/5015 61 3615/50 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.