CMM2 demo programs


Author Message
Sasquatch

Guru

Joined: 08/05/2020
Location: United States
Posts: 375
Posted: 01:54am 08 Jul 2020      

This simple program displays the distribution of the hardware random number generator as a dynamic histogram.  If you think you can see a pattern, try running it a few more times to see if the pattern persists LOL


'Entropy.bas

Setup:
 Mode 1,8
 Dim A%(800)
 XMax = MM.HRES - 1
 YMax = MM.VRES - 1

Start:
 CLS

Do
 X = FIX(RND * XMax)
 A%(X) = A%(X) + 1
 Pixel X,YMAX - A%(X),RGB(WHITE)
Loop until A%(X) > YMax 'OR Inkey$ <> ""