RE: LZ: Random Numbers
[Prev][Next][Index][Thread]
RE: LZ: Random Numbers
-
Subject: RE: LZ: Random Numbers
-
From: Frank <Jblaze77@msn.com>
-
Date: Wed, 9 Oct 96 23:58:49 UT
-
In-Reply-To: <>
ok well, what would everyone recommend for the simplest way to generate a
number from 1-4 making it random!?!?
----------
From: owner-list-zshell@lists.ticalc.org on behalf of SAM STAUFFER
Sent: Wednesday, October 09, 1996 4:51 PM
To: list-zshell@lists.ticalc.org
Subject: RE: LZ: Random Numbers
-> > huh? this is a little confusing for me, all i need is the code or
-> an > explanation (in moron terms) to produce a random number from 1-4
-> ! Random numbers are pretty complex... It might actually be SIMPLER
-> to search the rom dump. When you type Rand() in BASIC, you're
-> calling an incredibly complex routine - else you wind up getting
-> numbers that aren't random at all.
-> BTW, there's a bug in Tetris w/ the piece-selection algorithm - on
-> occasion it will give you about 20 square blocks in a row! This
-> demonstrates the importance of getting good random numbers...
Well you can do a semi-good one very simply, this is the same one that
Borland uses for all of their products ( C, Pascal, (C++??) ) I'm not
sure if C++ uses it.
A=A*(Any Number)+1
that's what they use, I think that the (Any Number) should be a prime.
That'l give you ok results.