rem Smudges ....... Rev 1.2 rem A J Tooth // January 2004 rem Modified July 2005 rem ============================================================================= rem This piece of trivia uses the fact that the sum of a "large" number of evenly rem distributed random variables is actually roughly Normally distributed. rem This is courtesy of the Central Limit Theorem. rem ============================================================================= on error if (err=17) then quit *FLOAT64 proc_fullscreen(xscreen%,yscreen%) repeat cls rem Various Parameter Limits Lim&=100 Num&=30+rnd(50) Cnt&=0 repeat rem Select a random origin xor%=rnd(xscreen%)-1 : yor%=rnd(yscreen%)-1 origin 2*xor%,2*yor% rem Select random 24-bit colour r&=rnd(255) : g&=rnd(255) : b&=rnd(255) colour 10,r&,g&,b& : gcol 10 for p%=1 to (1000+rnd(4000)) k%=0 rem Calculates the Arithmetic Mean of Lim% identical Random Variables for a&=1 to Lim& k%+=rnd(2000)-1000 next a& k=(1+2*rnd(1))*k%/Lim& Ang=2*pi*rnd(1) x%=int(k*cos(Ang)) : y%=int(k*sin(Ang)) plot x%,y% next p% Cnt&+=1 a$=inkey$(1) until (a$<>"") or (Cnt&>Num&) until a$<>"" a$=get$ quit end rem End of Program +++++++++++++++++++++++++++++++++++++++++++++ rem Set up use of Full Screen def proc_fullscreen(return xscreen%,return yscreen%) sys "GetSystemMetrics", 0 to xscreen% sys "GetSystemMetrics", 1 to yscreen% sys "SetWindowLong",@hwnd%,-16,&16000000 sys "SetWindowPos",@hwnd%,-1,0,0,xscreen%,yscreen%,0 vdu 23,22,xscreen%;yscreen%;8,16,16,1 : rem Set fullscreen mode mouse off : off : rem Turns off the Mouse Pointer and the Cursor endproc