| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: Random Seed |
-=> Quoting Sean Price to All <=-
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? Something that
SP> uses a system timer would probably work best. I wrote a bitmap
SP> changer a long time ago and have been cleaning it up and adding some
SP> features so I can release it as freeware. I'm using Watcom v.10.0 and
SP> the closest thing I could find to what I'm looking for is the clock()
SP> function, but this is ticks since the program's start which will be
SP> almost identical each time the program is run.
I (unfortunately) Don't know much about "C" in generaly (in
Pascal we have
the RANDOMIZE procedure). But for a generally "different" number
on each run,
the one thing that comes to mind is the millisecond timer.
DosQuerySysInfo - QSV_MS_COUNT
Seems to me that this would give you a "fairly" random seed
(or at least a
reason resistence to duplication.
Dave...
... THD ProScan support on the web, http://www.naples.net/~nfn03274
~~~ TGWave v1.12+
--- GEcho 1.11+
* Origin: fks Online! * Ontario, Canada * (905)820-7273 * (1:259/423)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: 259/423 400 99 250/99 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™.