'Written by Marsha Bowen as assignment #1 'Printing routines edited by WB 'declare function and integer variables DECLARE FUNCTION CountEq! (x1!, x2!, x3!, x4!, x5!) 'prepare screen CLS PRINT " This program simulates roll of five dice a 1000 times" PRINT " and estimates probability of our-of-a-kind event" PRINT " This will be repeated 10 times to see variability" PRINT PRINT "Theoretical probability of four-of-a-kind is "; USING "#.####"; 150 / 6 ^ 5 PRINT "Please wait patiently, until the first thousand rolls..." PRINT PRINT "Attempt #", "Probability (Simulation estimate)" RANDOMIZE TIMER 'Repeat process ten times FOR m = 1 TO 10 total = 0 'Simulate 1000 rolls of five dice FOR n = 1 TO 1000 'Generate random integer xi, 0 c THEN c = ck NEXT j 'assign value to function CountEq = c END FUNCTION