PEEK(78) and PEEK(79) in Applesoft BASIC

2 posts / 0 new
Last post
Offline
Last seen: 1 month 4 weeks ago
Joined: Jun 19 2020 - 16:06
Posts: 11
PEEK(78) and PEEK(79) in Applesoft BASIC

The Applesoft BASIC Reference says that PEEK(78) and PEEK(79) yield a value from a  "Random-Number Field" but doesn't say how those numbers are generated.  Can anyone tell me how they are generated?  In other words, how random are they?  Thanks.

Offline
Last seen: 6 hours 44 min ago
Joined: Jun 18 2010 - 13:54
Posts: 588
They come from a counter that

They come from a counter that increments whenever the computer is looking for keyboard input. So while the PRN generator uses a fixed sequence, this can be used to seed it with a number that comes from a random user interaction.

Log in or register to post comments