home *** CD-ROM | disk | FTP | other *** search
- 3 poke56,56:poke55,0:clr
- 5 dv=peek(186):ifdv<8thendv=8
- 10 te=4:ba=0:bo=0:print"[147]"
- 20 poke646,te:poke53281,ba:poke53280,bo
- 30 gosub60000
- 40 sys57812"i-menu $c000",dv,0:poke780,0:poke781,0:poke782,192:sys65493
- 45 sys57812"deal font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
- 49 rem first menu
- 50 fori=1to4:readfm$(i):next
- 52 for i=1to4:readb$(i):next
- 54 fori=1to2:readc$(i):next
- 55 p$=" press any key to continue"
- 56 te=4:poke646,te:bb$="[209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209]"
- 57 print"[147]"chr$(142)"":poke53272,31:for x=1to2:printbb$:next
- 58 for x=1to19:print"[209][209] [209][209]":next
- 59 printbb$:printleft$(bb$,39);
- 60 sys49152,4,10,8,68,3,1,fm$(1),fm$(2),fm$(3),fm$(4):geta$:a=val(a$)
- 70 on a goto5035,99,700,6000
- 80 data" read it "," try the game "," simulation "," return to loadstar "
- 99 g=1:ke(2)=0:tr(2)=0:ke(1)=0:tr(1)=0
- 100 pr=int(rnd(1)*3)+1
- 105 forw=1to3:d(w)=0:next
- 110 d(pr)=1
- 111 print"[147]":te=10:poke646,te
- 112 printbb$
- 113 forx=1to21:print"[209] [209]":nextx
- 114 printbb$""
- 115 poke214,3:poke211,28:sys58732:print"game #";g
- 120 sys49152,68,4,3,74,3,1,b$(1),b$(2),b$(3),b$(4):getch
- 130 data " door #1 "," door #2 "," door #3 "," quit "
- 135 if ch=4 then500
- 140 if pr=ch then goto190
- 150 if pr<>1 and ch<>1 then el=1
- 160 if pr<>2 and ch<>2 then el=2
- 170 if pr<>3 and ch<>3 then el=3
- 180 goto 240
- 190 n=int(rnd(1)*2)+1
- 200 if n=1 then el=pr+1
- 210 if el=4then el=1
- 220 if n=2 then el=pr-1
- 230 if el=0 then el=3
- 240 if ch<>1and el<>1thenl=1
- 250 if ch<>2and el<>2thenl=2
- 260 if ch<>3and el<>3thenl=3
- 270 poke214,12:poke211,4:sys58732
- 280 print"the prize is not behind door #";el
- 290 print:print"[150][209] do you want to keep door #";ch
- 300 print:print"[150][209] or trade for door #";l;"[150]?"
- 320 data " keep "," trade "
- 330 sys49152,66,25,6,74,3,1,c$(1),c$(2):getdr
- 332 if dr=4 then 510
- 333 ifdr=2thench=l
- 335 if dr=1thenke(1)=ke(1)+1
- 340 if dr=2 then tr(1)=tr(1)+1
- 350 d(pr)=1:ifd=2thench=l
- 360 if dr=1 then ke(2)=ke(2)+d(ch)
- 370 ifdr=2thentr(2)=tr(2)+d(ch)
- 380 poke214,18:poke211,14:sys58732
- 400 if d(ch)=1 thenprint" you win! ":gosub3000
- 410 if d(ch)=0 thenprint" you lost! ":gosub4000
- 420 print:print"[150][209] the prize was behind door #";pr
- 430 g=g+1
- 440 foru=1to700:next: print"[147]": goto 100
- 500 rem analysis
- 510 print"[147]"
- 515 if ke(1)=0then600
- 520 poke214,3:poke211,10:sys58732
- 530 print"you kept";ke(1);"[150]time";:ifke(1)<>1thenprint"s"
- 535 ifke(1)=1thenprint
- 540 print:printtab(7)"and won";ke(2);"[150]of those times"
- 550 printtab(4)"for a winning percentage of";int(((ke(2)+.001)/ke(1))*100);"[157]%"
- 555 if tr(1)=0then650
- 560 print:printtab(10) "[150]you traded";tr(1);"[150]time";:iftr(1)<>1thenprint"s"
- 565 iftr(1)=1thenprint
- 570 print:printtab(7)"and won";tr(2);"[150]of those times"
- 580 printtab(4)"for a winning percentage of";int(((tr(2)+.001)/tr(1))*100);"[157]%"
- 590 print:print:print:printtab(7)"[150]would you like to continue?"
- 595 e$=" yes ":f$=" no "
- 597 sys49152,66,18,19,74,3,1,e$,f$:geth
- 598 on h goto 100,56
- 600 print:print:printtab(2)"[150]you never stayed on your first choice":goto555
- 650 print:printtab(10)"[150]you never traded":goto590
- 700 sa=0:sb=0
- 705 for l=1to100
- 710 rem set value of doors
- 720 x=int(rnd(1)*3)+1
- 730 foru=1to3:d(u)=0:nextu
- 740 d(x)=1
- 750 rem contestants choose one door
- 760 y=int(rnd(1)*3)+1
- 770 ca=y:cb=y
- 780 rem eliminate one door
- 790 if x=ythen828
- 800 ifx<>1andy<>1thenz=1:goto900
- 810 ifx<>2andy<>2thenz=2:goto900
- 820 ifx<>3andy<>3thenz=3:goto900
- 828 n=int(rnd(1)*2)+1
- 830 if n=1thenz=x+1
- 840 ifz=4thenz=1:goto900
- 850 ifn=2thenz=x-1
- 860 ifz=0thenz=3
- 890 rem contestant b switches doors
- 900 ifz<>1andy<>1then a=1
- 910 ifz<>2andy<>2then a=2
- 920 ifz<>3andy<>3then a=3
- 930 cb=a
- 940 rem scores
- 950 sa=sa+d(y)
- 960 sb=sb+d(a)
- 970 poke214,4:poke211,3:sys58732
- 975 te=10:poke646,te
- 980 print"contestants picked door #";y
- 990 print:printtab(3)"[150]the prize is not behind door #";z
- 1000 print:printtab(3)"[150]contestant b trades for door #"; a
- 1010 print:printtab(3)"[150]the prize was behind door #";x
- 1020 if d(y)=1 thenw$="a"
- 1030 if d(a)=1 thenw$="b"
- 1040 print:printtab(3)"[150]contestant ";w$;"[150] wins game #";l
- 1050 print:print:printtab(3)"[150]contestant a [150]contestant b"
- 1060 print:printtab(5)"[150](keeps) (trades)"
- 1070 print:printtab(4)"score:";sa;"[150] score:";sb
- 1080 forg=1to10:nextg:next
- 1090 poke214,21:poke211,0:sys58732
- 1099 gosub3000
- 1100 printp$
- 1110 getv$:ifv$=""then1110
- 1120 goto56
- 3000 s=54272:h=24:a=0
- 3010 pokes+5,20:pokes+6,8:pokes+24,15
- 3020 pokes+1,h:pokes,0
- 3030 pokes+4,17:fort=0to25:next
- 3040 pokes+4,16
- 3050 a=a+1:ifa>15thenreturn
- 3060 ifh=24thenh=15:goto3020
- 3070 ifh=15thenh=24:goto3020
- 3080 return
- 4000 s=54272:fori=stos+24:pokei,0:next
- 4010 pokes+5,27:pokes+6,73
- 4020 p=1650:pokes+24,15:pokes+4,33
- 4030 pokes+1,int(p/256):pokes,pand255
- 4040 p=p-50:ifp>1000then4030
- 4050 pokes+4,32:forp=1to1000:next
- 4060 return
- 5000 print"[147]"
- 5005 te=4:poke646,te
- 5010 printbb$
- 5020 forx=1to22:print"[209] [209]":nextx
- 5030 printbb$""
- 5031 te=10:poke646,10
- 5032 return
- 5035 gosub5000
- 5040 te=10:poke646,10
- 5050 poke214,3:poke211,2:sys58732
- 5060 print"'play the game' is your chance to"
- 5070 printtab(2)"test your solution to the"
- 5080 printtab(2)"statistical question. the first"
- 5090 printtab(2)"menu gives you a choice of the"
- 5100 printtab(2)"three doors. use the crsr keys"
- 5105 printtab(2)"and return to select. then the"
- 5110 printtab(2)"the computer will reveal one"
- 5120 printtab(2)"of the other doors, and give you"
- 5130 printtab(2)"the next option: keep your first"
- 5140 printtab(2)"choice or trade for the other"
- 5150 printtab(2)"door. when you've made your
- 5160 [153][163]2)"choice, it will reveal whether
- 5170 printtab(2)"you've won or lost, and show where
- 5180 [153][163]2)"the prize was. a counter in the
- 5190 printtab(2)"top right of the screen will let
- 5200 [153][163]2)"you know how many games you've
- 5205 printtab(2)"played.
- 5210 [151]214,22:[151]211,0:[158]58732:[153]p$
- 5215 [161]a$:[139]a$[178]""[167]5215
- 5220 [141]5000
- 5230 [151]214,4:[151]211,2:[158]58732
- 5240 [153]"when you select quit, you'll see"
- 5250 [153][163]2)"how many times you kept your first"
- 5260 [153][163]2)"choice, how many of those times
- 5270 printtab(2)"you won, and what your percentage
- 5280 [153][163]2)"was -- and the same statistics for
- 5290 printtab(2)"the times you traded. you may
- 5300 [153][163]2)"then choose to play some more
- 5310 printtab(2)"rounds or return to the main menu.
- 5320 [153][163]2)"remember that it is possible to
- 5330 printtab(2)"have a lucky streak. according to
- 5340 [153][163]2)"my mathematically inclined husband"
- 5350 [153][163]2)"(and my own experimentation), it's"
- 5360 [153][163]2)"necessary to play about 30 games"
- 5370 [153][163]2)"each way before you'll begin to
- 5380 printtab(2)"get fairly consistent results."
- 5390 poke214,22:poke211,0:sys58732:printp$
- 5400 geta$:ifa$=""then5400
- 5410 gosub5000
- 5420 poke214,4:poke211,2:sys58732
- 5430 print"the 'simulation' program quickly"
- 5440 printtab(2)"tests the problem 100 times. two"
- 5450 printtab(2)"contestants 'play' simultaneously."
- 5460 printtab(2)"they choose the same door for
- 5470 [153][163]2)"their first choice. after the
- 5480 printtab(2)"computer reveals a booby-prize
- 5490 [153][163]2)"door, contestant a always keeps
- 5500 printtab(2)"the original choice; contestant b"
- 5510 printtab(2)"always switches."
- 5560 poke214,22:poke211,0:sys58732:printp$
- 5570 geta$:ifa$=""then5570
- 5580 goto56
- 6000 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
- 6010 print"[147][144][159]";:poke53272,21
- 6020 ifer<>63thenend
- 6030 print"[144]load"chr$(34)"hello connect"chr$(34)",8"
- 6040 print"run"
- 6050 poke631,13:poke632,13:poke198,2:end
- 10000 open15,8,15,"s0:deal":close15:save"deal",8:end
- 60000 print"[147]":z$=" [152] ":poke214,10:print
- 60010 print" [155][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]":fori=0to11:printz$:next
- 60020 print" [151][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][152]"
- 60030 z$(0)="[204] [197] [212] ' [211] [205] [193] [203] [197] [193] [196] [197] [193] [204]":z$(1)="by [195]ayre [211]cott
- 60040 z$(2)[178]"(NULL)1.0 (len) 1992 by (NULL)oftdisk, right$nc."[170][199](13)
- 60050 z$(3)[178]"(NULL)his program is the copyrighted work
- 60060 z$(4)="of [211][207][198][212][196][201][211][203] [208][213][194][204][201][211][200][201][206][199]. [201]t is not"
- 60070 z$(5)="shareware or in the public domain."
- 60080 z$(6)="[210]eport illegal distribution of":z$(7)="this program by calling"
- 60090 z$(8)="1-800-831-2694 or 1-318-221-8718.":poke214,12:print
- 60100 fori=0to8:printtab(20-(len(z$(i))/2))""z$(i):next:return
-