'=========================================================================== ' Subject: CALCULATE THEORY OF PROBABILTY Date: 07-03-97 (12:01) ' Author: Brian Mahocker Code: QB, QBasic, PDS ' Origin: Kain121182@aol.com Packet: ALGOR.ABC '=========================================================================== 'This is an experiment intended to document the theory of probobility. 'Use how u want. But if you do use this stuff in your other programs, 'please at least give me credit!! CLS : INPUT "What do you want the delay to be? : ", delay: COLOR 7 CLS : RANDOMIZE TIMER COLOR 7 LOCATE 1, 1: PRINT "Number 1 :" LOCATE 2, 1: PRINT "Number 2 :" LOCATE 3, 1: PRINT "Total Numbers drawn : " LOCATE 5, 1: PRINT "Times Equal :" LOCATE 8, 1: PRINT "The higher number is number :" DO COLOR 7 LOCATE 7, 1: PRINT "Numbers are currently"; : COLOR 15: PRINT apart&; : COLOR 7: PRINT "apart and going "; : COLOR 15: PRINT CHR$(going) + " ": COLOR 7 LOCATE 10, 1: PRINT "Highest amount ever being apart is"; : COLOR 15: PRINT highapart&: COLOR 7 LOCATE 12, 1: PRINT "Number 1 has been highest"; : COLOR 15: PRINT number1high&; : COLOR 7: PRINT "times." LOCATE 13, 1: PRINT "Number 2 has been highest"; : COLOR 15: PRINT number2high&; : COLOR 7: PRINT "times." LOCATE 15, 1: COLOR 7: PRINT "Press "; : COLOR 15: PRINT "P"; : COLOR 7: PRINT " at any time to pause count then press again to continue" COLOR 15 LOCATE 1, 11: PRINT num1& LOCATE 2, 11: PRINT num2& LOCATE 5, 14: PRINT equal& LOCATE 8, 30: PRINT higher& ' LOCATE 3, 22: PRINT totaldrawn& IF UCASE$(INKEY$) = "P" THEN DO LOOP UNTIL UCASE$(INKEY$) = "P" END IF LET pick = INT(RND * 2) + 1 IF pick = 1 THEN LET num1& = num1& + 1 IF pick = 2 THEN LET num2& = num2& + 1 IF delay = 0 THEN GOTO start LET time = 0: DO: LET time = time + 1: LOOP UNTIL time = delay start: IF num1& = num2& THEN 'SOUND 3000, .5 LET equal& = equal& + 1 LET higher& = 0 END IF LET oldapart& = apart& IF num1& > num2& THEN LET apart& = (num1& - num2&) LET higher& = 1 END IF IF num2& > num1& THEN LET apart& = (num2& - num1&) LET higher& = 2 END IF IF oldapart& > apart& THEN LET going = 25 IF oldapart& < apart& THEN LET going = 24 IF apart& > highapart& THEN LET highapart& = apart& IF higher& = 1 THEN LET number1high& = number1high& + 1 IF higher& = 2 THEN LET number2high& = number2high& + 1 IF INKEY$ = CHR$(27) THEN GOTO totalexit LET totaldrawn& = totaldrawn& + 1 LOOP totalexit: