Random of zero
Shari
gypsyware at earthlink.net
Wed May 14 07:04:01 EDT 2003
>How does the random function work?
>Most, if not all random functions use:
>z[n] = a * z [n-1] mod m
So in a C/C++ language, or Pascal, or any of the non-English types,
does a random(x) function exist, or does the programmer have to write
their own random(x) function, as you show above?
I often hear talk about *seeds* in random functions, which assumes
the codewriter is operating at a baser level of coding than we are.
I know MetaTalk offers randomseed as well.
I've always suspected that random(x) is not always as random as one
would expect -not specific to Metacard, I noticed this primarily in
Hypercard, when I'd see the same number come up several times in
succession, for example with a dice roll. Granted there are only six
choices for the number, but I noticed that at any given time, there
was usually one number that was hot, and came up more frequently than
other numbers.
This is useful info, as random(x) while usually it does not matter if
a number or range of numbers is *hot*, but in some cases, it matters
a lot.
Very interesting stuff, indeedy :-)
Shari C
--
--Shareware Games for the Mac--
http://www.gypsyware.com
More information about the metacard
mailing list