[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Random Number Question



Hello folks,

    Do you know how random number work?  You use either Applesoft BASIC or 
Integer BASIC.  You use the function like RND().  Take a look at my example 
here.

10 PRINT INT( RND( 10 ) * 10)
20 GET A$
30 GOTO 10

    Apple II has chosen the random number of the range from 0 to 9 and print 
each random number to the screen.  How do Apple II know to guess random 
number?  Take a look at monitor routine $FD1B.  $4E and $4F are the high 
byte of random and low byte of random.  It waits for the key to be pressed 
while random number continues to increment.  If key is pressed, random 
number stops to increment before it is printed to the screen.  Repeat the 
procedure to increment random number while it waits for a key.
    Do you know the alternative implementation rather than keyin?  Do you 
think to implement the clock to replace keyin?  The random number stops to 
increment each one second while clock reads one second and another.  What do 
you think?

-- 

Yours Truly,
Bryan Parkoff