[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple II Random Events?
Gabriel Morales <Togega@Concentric.net> writes:
>I was wondering:
>How does an Apple II, say using the BASIC RND command, determine a
>random number?
>Since the Apple IIgs has a built-in clock, I suppose it could simply
>look at the date string (and multiply it by a determined number, for
>example) to provide a "random" number, but what about all other Apple IIs?
>How does an Apple II generate a random number?
Simple Answer: It doesn't.
Complex Answer: The RND() function returns a pseudo random sequence.
If you know the previous number returned you can determine the next
one. You can seed the sequence by passing a negative number to RND().
I assume that the first number generated after power up (provided you
do not seed it first) is either fixed or depends on the power up
contents of a particular memory location (or two).
--
David Wilson School of IT & CS, Uni of Wollongong, Australia david@uow.edu.au