home *** CD-ROM | disk | FTP | other *** search
- 1 rem ************************
- 2 rem * *
- 3 rem * graphics factory *
- 4 rem * animation demo *
- 5 rem * "roll 'em", (c) 1989 *
- 6 rem * by: m.h.westerweel *
- 7 rem * *
- 8 rem ************************
- 9 :
- 10 rem action control unit
- 15 rem ===================
- 20 :
- 25 poke53280,14:poke646,14:poke53281,6
- 26 gosub1245:fi$="cr/roll*":gosub1145
- 30 prints1$spc(8)i$" [144]";
- 35 getyn$:ifyn$<>"n"andyn$<>"y"then35
- 40 printyn$"[145]":ifyn$="n"then50
- 45 gosub1645:poke53272,21
- 50 fi$="cr/action dice":gosub1145
- 55 :
- 60 gosub970:co=1:x=1:q=q+1:ifq>nthenq=1
- 65 forsb=4to10:sb(sb)=0:next:od=0:do=0
- 70 :
- 75 rs=0:gosub860
- 80 ifx=1thengosub155:gosub270
- 85 :
- 90 :forop=3to5:print"[129]"op$(op):next
- 95 :print"[146][144]"d1$(d1)d2$(7-d2)
- 100 gosub895:oncogoto105,115
- 105 gosub425:ifx<>2thengosub1195
- 110 goto120
- 115 gosub560:ifdt<4ordt>10thengosub1195
- 120 print"[146][144]"dt$(dt):oncogoto125,90
- 125 onxgoto60,75
- 130 :
- 135 rem enter bet
- 140 rem =========
- 145 :
- 150 rem number entry processor
- 155 prints1$"[156] [144]return[156] accepts ";
- 160 print"bet, [144]del[156] deletes bet.[145]"
- 165 bt$="":printfb$(2)er$"";
- 170 gettb$:iftb$=""thengosub240:goto170
- 175 iftb$<>chr$(13)orbt$=""then190
- 180 bt=val(bt$):ifbt<5then165
- 185 print" "s1$"[156]"z$"[145]":bt$="":return
- 190 iftb$<>chr$(20)orbt$=""then205
- 195 bt$=left$(bt$,len(bt$)-1)
- 200 print"[157][144]? [157][157]";
- 205 iftb$<"0"ortb$>"9"then220
- 210 iflen(bt$)>2then220
- 215 bt$=bt$+tb$:printtb$"[144]?[157]";
- 220 ifbt$=""orleft$(bt$,1)="0"then165
- 225 gettb$:goto175
- 230 :
- 235 rem flashing cursor
- 240 forrv=1to2:printv$(rv)"[144]?[157]";
- 245 forw=1to100:nextw:next:return
- 250 :
- 255 rem get pass or no pass
- 260 rem ===================
- 265 :
- 270 getpn$
- 275 ifpn$="p"thenprintpn$(1):goto295
- 280 ifpn$="n"thenprintpn$(2)x$:goto295
- 285 forpn=1to2:printpn$(pn)
- 290 forw=1to100:nextw:next:goto270
- 295 return
- 300 :
- 305 rem get collect or gamble
- 310 rem =====================
- 315 :
- 320 getcg$
- 325 ifcg$="c"thenprintcg$(1):goto345
- 330 ifcg$="g"thenprintcg$(2):goto345
- 335 forcg=1to2:printcg$(cg)
- 340 forw=1to100:nextw:next:goto320
- 345 return
- 350 :
- 355 rem get gamble or roll
- 360 rem ==================
- 365 :
- 370 getgr$
- 375 ifgr$="g"thenprintgr$(1):goto395
- 380 ifgr$="r"thenprintgr$(2):goto395
- 385 forgr=1to2:printgr$(gr)
- 390 forw=1to100:nextw:next:goto370
- 395 return
- 400 :
- 405 rem come out roll
- 410 rem =============
- 415 :
- 420 rem come out = pass
- 425 ifpn$<>"p"then455
- 430 ifdt>7then440
- 435 ondtgoto430,480,480,520,520,520,490
- 440 on(dt-7)goto520,520,520,480,480
- 445 :
- 450 rem come out = no pass
- 455 ifdt>7then465
- 460 ondtgoto425,490,490,520,520,520,480
- 465 on(dt-7)goto520,520,520,490,490
- 470 :
- 475 rem come out : win/loss
- 480 rs=-bt:b(q)=b(q)+rs:gosub860
- 485 gosub1020:x=1:goto530
- 490 rs=bt:gosub860:forpp=1to5:gosub1055
- 495 next:x=2:b(q)=b(q)+rs:gosub320
- 500 gosub860:ifcg$<>"g"then530
- 505 bt=2*bt:gosub860:goto530
- 510 :
- 515 rem come out : point made
- 520 od=bt:do=od:r=1:gosub815
- 525 x=1:co=2:sb(dt)=bt:tb=bt:bt=0
- 530 return
- 535 :
- 540 rem points routine
- 545 rem ==============
- 550 :
- 555 rem (pass) points before 7
- 560 ifpn$<>"p"then590
- 565 ifdt>7then575
- 570 ondtgoto560,790,790,615,615,615,700
- 575 on(dt-7)goto615,615,615,790,790
- 580 :
- 585 rem (no pass) 7 before points
- 590 ifdt>7then600
- 595 ondtgoto560,790,790,615,615,615,730
- 600 on(dt-7)goto615,615,615,790,790
- 605 :
- 610 rem gamble or roll?
- 615 ifsb(dt)=0then630
- 620 ifpn$="n"then700
- 625 ifpn$="p"then655
- 630 gosub370:ifgr$="r"then790
- 635 sb(dt)=tb:od=sb(dt):do=do+tb
- 640 r=1:gosub815:goto790
- 645 :
- 650 rem (pass=win) collect or gamble?
- 655 forw=1to5:gosub1055:next
- 660 rs=sb(dt)*py(dt):rs=int(rs+.5)
- 665 gosub860:gosub320:b(q)=b(q)+rs
- 670 ifcg$<>"g"thenrs=0:gosub860:goto790
- 675 sb(dt)=sb(dt)+rs:od=sb(dt):do=do+rs
- 680 rs=0:r=1:gosub815:gosub860:goto790
- 685 :
- 690 rem (pass=loss) : seven out
- 695 rem (no pass=loss) : point repeats
- 700 gosub1020:rs=0:forsb=4to10
- 705 rs=rs-sb(sb):next:b(q)=b(q)+rs
- 710 gosub860:gosub1195:co=1
- 715 gosub1165:x=1:goto790
- 720 :
- 725 rem (no pass=win) : 7 before point
- 730 forw=1to5:gosub1055:next:ct=0
- 735 rs=0:forsb=4to10:py=sb(sb)*(yp(sb))
- 740 rs=rs+py:ifsb(sb)>0thenct=ct+1
- 745 next:rs=int((ct*rs)+.5)
- 750 gosub860:gosub320:b(q)=b(q)+rs:rs=0
- 755 gosub860:ifcg$<>"g"then785
- 760 do=0:forsb=4to10:py=sb(sb)*(yp(sb))
- 765 sb(sb)=sb(sb)+int((ct*py)+.5)
- 770 dt=sb:ifsb(sb)=0then780
- 775 od=sb(sb):do=do+sb(sb):r=2:gosub815
- 780 next:rs=0:gosub860
- 785 ct=0:print"[146][144]"dt$(7)
- 790 return
- 795 :
- 800 rem print side bet on point box
- 805 rem ===========================
- 810 :
- 815 printfb$(2)er$fb$(3)""do
- 820 od$=str$(od)
- 825 od$=right$(od$,len(od$)-1)
- 830 printv$(r)dt$(dt)"[145][145][145][157][157][157][157]"od$
- 835 return
- 840 :
- 845 rem print results
- 850 rem =============
- 855 :
- 860 printfb$(1)er$" "pl$(q)fb$(2)er$;bt
- 865 printfb$(3)er$;do;fb$(4)er$;rs
- 870 printfb$(5)er$;b(q):return
- 875 :
- 880 rem shake, rattle & roll
- 885 rem ====================
- 890 :
- 895 d1=int(6*rnd(1))+1
- 900 d2=int(6*rnd(1))+1
- 905 ford=1to3:fordd=1to6
- 910 printv$(d)d1$(dd)d2$(7-dd)
- 915 poke54296,15:poke54296,0
- 920 next:next:fordd=1to6
- 925 ifdd<>d1thenprintd1$(dd)
- 930 ifdd<>d2thenprintd2$(7-dd)
- 935 poke54296,15:poke54296,0:next
- 940 dt=(7-d1)+(7-d2)
- 945 print"[144]"dt$(dt):return
- 950 :
- 955 rem reset screen
- 960 rem ============
- 965 :
- 970 fortd=2to12:print"[146][144]"dt$(td);
- 975 print"[145][145][145][157][157][157][157] ":next:co=1
- 980 forop=1to5:print"[129]"op$(op):next
- 985 print"[146][144]"d1$(d1)d2$(7-d2)y$
- 990 return
- 995 :
- 1000 rem sound effects
- 1005 rem =============
- 1010 :
- 1015 rem "buzz" for loss
- 1020 pokes+3,10:pokes+2,5:pokes+5,15
- 1025 pokes+6,0:pokes+24,15:pokes+1,5
- 1030 pokes,127:pokes+4,65:fort=1to500
- 1035 next:pokes+4,64:fort=1to100:next
- 1040 return
- 1045 :
- 1050 rem "ping" for win
- 1055 pokes+3,120:pokes+2,127:pokes+5,10
- 1060 pokes+6,10:pokes+24,15:pokes+1,90
- 1065 pokes,127:pokes+4,65:fort=1to100
- 1070 next:pokes+4,64:fort=1to50:next
- 1075 return
- 1080 :
- 1085 rem print canvas
- 1090 rem ============
- 1095 :
- 1100 zz=0:print"";:forz=1to24
- 1105 print"[156]"z$:zz=zz+40
- 1110 poke55295+zz,4:poke1023+zz,160
- 1115 next:print"[156]"z$"[145]":poke56295,4
- 1120 poke2023,160:return
- 1125 :
- 1130 rem print screen files
- 1135 rem ==================
- 1140 :
- 1145 open8,8,8,"0:"+fi$+",s,r"
- 1150 forf=1to23:input#8,f1$:input#8,f2$
- 1155 fl$(f)=f1$+f2$:next:close8
- 1160 gosub1100
- 1165 print"";:forf=1to23
- 1170 print""fl$(f):next:return
- 1175 :
- 1180 rem space bar prompt
- 1185 rem ================
- 1190 :
- 1195 prints1$spc(8)sb$"...[145]"
- 1200 forw=1to100:nextw
- 1205 prints1$spc(8)bs$"...[145]"
- 1210 forw=1to100:nextw
- 1215 getdr$:ifdr$<>" "then1195
- 1220 prints1$"[156]"z$"[145]":return
- 1225 :
- 1230 rem enter players
- 1235 rem =============
- 1240 :
- 1245 print"[147] number of players (1-9)";
- 1250 inputn$:n=val(n$)
- 1255 ifn<1orn>9then1245
- 1260 fornn=1ton:print"[147] player";nn;
- 1265 inputpl$(nn):pl=len(pl$(nn))
- 1270 ifpl>0andpl<10then1285
- 1275 print" ...9 letters max!!!"
- 1280 nn=nn-1:forw=1to1500:nextw
- 1285 next:print"[147]"
- 1290 :
- 1295 rem set up graphics
- 1300 rem ===============
- 1305 :
- 1310 rem initialize:
- 1315 rem grafix, rnd, sounds, pay outs
- 1320 dimfl$(23),dt$(12):t=rnd(-ti)
- 1325 poke53281,15:poke53280,4
- 1330 forz=1to39:z$=z$+" ":next
- 1335 gosub1100:print"[146][144]"spc(12);
- 1340 print" setting up... "
- 1345 s=54272:forl=stos+24:pokel,0:next
- 1350 py(4)=2:py(5)=1.5:py(6)=1.2
- 1355 py(10)=2:py(9)=1.5:py(8)=1.2
- 1360 yp(4)=.5:yp(5)=.6667:yp(6)=.8333
- 1365 yp(10)=.5:yp(9)=.6667:yp(8)=.8333
- 1370 :
- 1375 rem field square strings
- 1380 s1$=""
- 1385 forr1=1to36:r1$=r1$+"":next
- 1390 t1$=" 2 3 4 5 6 7 8 9101112"
- 1395 q$="[157][157][157][157]":fordt=2to12:reads2,r2
- 1400 s2$=left$(s1$,s2)
- 1405 r2$=left$(r1$,r2)
- 1410 m$=mid$(t1$,(dt-1)*2-1,2)
- 1415 t2$="[207][183][183][208]"+q$+"[180]"+m$+"[170]"+q$+"[204][175][175][186]"
- 1420 dt$(dt)=s2$+r2$+t2$:next
- 1425 data 10,6,11,10,5,6,4,10,3,14,11
- 1430 data 18,3,22,4,26,5,30,11,26,10,30
- 1435 :
- 1440 rem dice face strings
- 1445 a$=" ":b$=" [209]":c$=" [209] "
- 1450 d$="[209] ":e$="[209] [209]":f$="[157][157][157]"
- 1455 dd$(1)=a$+f$+c$+f$+a$
- 1460 dd$(2)=b$+f$+a$+f$+d$
- 1465 dd$(3)=b$+f$+c$+f$+d$
- 1470 dd$(4)=e$+f$+a$+f$+e$
- 1475 dd$(5)=e$+f$+c$+f$+e$
- 1480 dd$(6)=e$+f$+e$+f$+e$
- 1485 fordd=1to6:s2$=left$(s1$,4*dd-3)
- 1490 d1$(dd)=s2$+""+dd$(7-dd)
- 1495 d2$(dd)=s2$+r1$+dd$(dd):next
- 1500 v$(1)="[144]":v$(2)="[146][144]":v$(3)="[144]"
- 1505 :
- 1510 rem feedback & option strings
- 1515 op$="pncgr":forop=1to5
- 1520 op$(op)=mid$(op$,op,1)
- 1525 s2$=left$(s1$,op+17)
- 1530 fb$(op)=s2$+left$(r1$,14)
- 1535 op$(op)=s2$+left$(r1$,26)+op$(op)
- 1540 next:er$=" [157][157][157][157][157][157][157][157][157][157]"
- 1545 pn$(1)="[144]"+op$(1)+"[129]"+op$(2)
- 1550 pn$(2)="[129]"+op$(1)+"[144]"+op$(2)
- 1555 cg$(1)="[144]"+op$(3)+"[129]"+op$(4)
- 1560 cg$(2)="[129]"+op$(3)+"[144]"+op$(4)
- 1565 gr$(1)="[144]"+op$(4)+"[129]"+op$(5)
- 1570 gr$(2)="[129]"+op$(4)+"[144]"+op$(5)
- 1575 :
- 1580 sb$="[156]hit [144]spacer[156] to continue"
- 1585 bs$="[156]hit [144][146]spacer[156] to continue"
- 1590 x$="[146][144]1/2[145]2/3"
- 1595 x$=x$+"[145]5/65/62/31/2"
- 1600 y$="[144]2/1[145]3/2"
- 1605 y$=y$+"[145]6/56/53/22/1"
- 1610 i$="[156]instructions [144]y[156]es/[144]n[156]o?..."
- 1615 ff$="[144][198]1[156]:forward, [144][198]3[156]:backward"
- 1620 rt$=chr$(13)+"":return
- 1625 :
- 1630 rem read/print instructions
- 1635 rem =======================
- 1640 :
- 1645 dima$(78):open8,8,8,"0:instr*,s,r"
- 1650 fora=1to78:input#8,a$,b$:ab$=a$+b$
- 1655 a$(a)=ab$:next:close8:fi$="cr/lc*"
- 1660 gosub1145:poke53272,23
- 1665 :
- 1670 p3=0:forp=1to5:j=17:ifp=5thenj=10
- 1675 print""spc(35)"[146][144]";p;""
- 1680 forp2=1toj:p3=p3+1:printrt$;
- 1685 m=val(left$(a$(p3),3)):form2=1tom
- 1690 m$=mid$(a$(p3),3*m2+1,3)
- 1695 printchr$(val(m$));:next:next
- 1700 :
- 1705 prints1$"[145]"spc(8)ff$
- 1710 getg$:ifg$=""then1710
- 1715 ifg$=chr$(133)then1730
- 1720 ifg$<>chr$(134)orp3<18then1710
- 1725 p=p-2:p3=p3-(j+17)
- 1730 gosub1165:next:prints1$"[145][156]"z$
- 1735 return
- 4975 :
- 4980 end
- 4985 rem modify program
- 4990 rem ==============
- 4995 :
- 5000 save"re(2)",8:open15,8,15
- 5005 print#15,"s0:roll 'em"
- 5010 print#15,"r0:roll 'em=re(2)"
- 5015 close15:end
-