On the Model 100 you can do this:

10 DEFINTR,S:R=-1745:S=-902:POKES,PEEK(R):POKES+1,PEEK(R+1)

Theory:

After defining R and S as INT type variables, the values of each will be:

  R = -1745 = 64436 - 1745 = 63791 = F92Fh
  S = -902   = 65536 - 902 = 64634  = FC7Ah

R points to a memory location that is updated by the background task.  It changes 125 times per second (or something like that). R+1 points to a count down value used by the background task (12 down to 1) that counts when R gets to 125.

S points to one of the bytes in the RND number seed
S+1 points to another byte in the RND number seed

So this one line of code grabs a random number and puts it in the RND seed.  The random number will be one of 11 * 125 = 1375 possible random values depending on when the program is started.

For T200, these addresses would be R=-3553 and S=-2259

Ken

On 12/26/23 3:15 PM, [email protected] wrote:

In game programs that I’ve written,  I do a splash page.  To advance from the splash page to the actual game, the user is asked to press any key.

I check INKEY$ and if it is equal to nothing (“”), I get a random number and loop back to the INKEY$ check.  Once the user presses a key, the program breaks out of the loop.

So even if the random number sequence is predetermined, there will be a random number of random numbers obtained before the game starts.  The number of random numbers obtained is based on the time delay for the player to “press any key”.

I hope this helps.  If not, I can send a code snippet.

Lloyd

*From:* M100 <[email protected]> *On Behalf Of *Peter Vollan
*Sent:* Tuesday, December 26, 2023 4:29 PM
*To:* Model 100 Discussion <[email protected]>
*Subject:* [M100] dice

Whoever wrote the Model 100 Dice Box, how do you account for the fact that supposedly the Model 100 will generate the same random numbers every time it is asked to due to its limited memory?

Reply via email to