home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 2 #3
/
Commodore_Disk_User_Vol.2_3_1989_-_Side_B.d64
/
champ3
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
17KB
|
519 lines
10 rem ******************
20 rem * *
30 rem * champ dominoes *
40 rem * *
50 rem * by *
60 rem * *
70 rem * athol mcewan *
80 rem * 1988 *
90 rem * *
100 rem ******************
110 rem **initiate game**
120 poke53265,peek(53265)or16
130 poke51,144:poke52,148:poke55,144:poke56,148:clr:do=7:le=1:op=2
140 gosub4430:poke53280,0:poke53281,0
150 print"[147]";:fora=0to8:printtab(2)do$(a):next
160 print"[158]"tab(12)"by athol mcewan":gosub4520:gosub5060
170 print"[158] do you need instructions [y/n] [146] n"
180 printtab(35)"[145]";:poke198,0:inputa$
190 ifa$="n"then220
200 ifa$="y"then4670
210 print"[145][145][145]":goto170
220 print"[147]";:fora=0to8:printtab(2)do$(a):next:rw=13:gosub2380
230 ifpeek(251)>4andpeek(251)<11thendo=peek(251)
240 ifpeek(252)>0andpeek(252)<3thenle=peek(252)
250 ifpeek(253)>0andpeek(253)<3thenop=peek(253)
260 printtab(15)"[145][145][145][158] select game [146]":printtab(4)
270 print" how many opponents [1 or 2]:[146] "op:printtab(33)"[145]";:inputop
280 ifop<1orop>2thenprint"[145][145]"tab(4):goto270
290 printtab(4)
300 print" number of dominoes: [146]"do:printtab(24)"[145]";:poke198,0:inputdo
310 ifdo<5ordo>9thenprint"[145][145][145]":do=7:goto290
320 printtab(4)" level [146]":print:printtab(4)"1. novice"
330 printtab(4)"2. championship"
340 printtab(4):print" select level [146] "le:printtab(18)"[145]";:poke198,0:inputle
350 ifle<1orle>2thenprint"[145][145][145]":goto340
360 td=do*(op+1):print"[147]":rw=11:gosub2380:fora=5to7
370 printtab(3);mid$(do$(a),3,31):next
380 rem **deal dominoes**
390 eq=0:fora=1todo:eq=eq+1:fori=1to(op+1)
400 rq=int(28*rnd(0)+1):ifs$(rq)=""then400
410 dd$(i)=s$(rq):s$(rq)=""
420 next:ifop=1thenm$(eq)=dd$(1):c$(eq)=dd$(2):next:goto450
430 m$(eq)=dd$(1):c$(eq)=dd$(2):h$(eq)=dd$(3):next
440 rem **set up game screen**
450 print" [158]max":ifop=2thenprint" joe"
460 ifop=2thenb2=do:d2=do:g2=do:gosub2490:gosub2510:gosub2440:gosub3390:goto480
470 ifop=1thenb2=do:d2=do:gosub2490:gosub2440:gosub3390
480 ifop=2thengosub3240:print"";tab(30)"[150]max[158]joeyou":mr=0:cr=0:gr=0:goto500
490 gosub3240:print"";tab(30)"[150]max you":mr=0:cr=0
500 print" [158][176][192][192][174]":print" [194][194]":print" [173][192][192][189]"
510 rem **check for highest domino**
520 ifs$(28)=""thenx=6:goto600
530 ifs$(26)=""thenx=5:goto600
540 ifs$(23)=""thenx=4:goto600
550 ifs$(19)=""thenx=3:goto600
560 ifs$(14)=""thenx=2:goto600
570 ifs$(8)=""thenx=1:goto600
580 ifs$(1)=""thenx=0:goto600
590 goto690
600 fori=1todo:l=val(left$(m$(i),1)):r=val(right$(m$(i),1)):xx=l+r
610 ifl=xandr=xthenpp=i:pt=3:goto850
620 next
630 fori=1todo:l=val(left$(c$(i),1)):r=val(right$(c$(i),1)):xx=l+r
640 ifl=xandr=xthenpp=i:pt=1:n$="max":goto870
650 next:ifop=1then690
660 fori=1todo:l=val(left$(h$(i),1)):r=val(right$(h$(i),1)):xx=l+r
670 ifl=xandr=xthenpp=i:pt=2:n$="joe":goto900
680 next
690 ifs$(27)=""thenx=11:goto750
700 ifs$(25)=""thenx=10:goto750
710 ifs$(22)=""ors$(24)=""thenx=9:goto750
720 ifs$(21)=""ors$(18)=""thenx=8:goto750
730 ifs$(20)=""ors$(17)=""thenx=7:goto750
740 ifs$(16)=""ors$(12)=""ors$(7)=""thenx=6:goto750
750 fori=1todo:xx=val(left$(m$(i),1))+val(right$(m$(i),1))
760 ifxx=xthenpp=i:pt=3:goto850
770 next
780 fori=1todo:xx=val(left$(c$(i),1))+val(right$(c$(i),1))
790 ifxx=xthenpp=i:pt=1:n$="max":goto870
800 next:iop=1then840
810 fori=1todo:xx=val(left$(h$(i),1))+val(right$(h$(i),1))
820 ifxx=xthenpp=i:pt=2:n$="joe":goto900
830 next
840 rem **play highest domino**
850 lc=10:rc=10:gosub2400
860 printtab(10)"[158][145][145]you have first drop":fort=1to500:next:goto930
870 gosub2400:printtab(10)"[158][145][145]"n$" has first drop":fort=1to500:next
880 xx$=c$(pp):c$(pp)="":gosub2660:gosub3290:gosub2400:v1=val(left$(xx$,1))
890 v2=val(right$(xx$,1)):l=v1:r=v2:gosub3450:gosub3330:gosub2850:goto960
900 gosub2400:printtab(10)"[158][145][145]"n$" has first drop":fort=1to500:next
910 xx$=h$(pp):h$(pp)="":gosub2750:gosub3310:gosub2400:v1=val(left$(xx$,1))
920 v2=val(right$(xx$,1)):l=v1:r=v2:gosub3450:gosub3330:gosub2850:goto960
930 xx$=m$(pp):m$(pp)="":gosub2530:gosub3270:gosub2400:v1=val(left$(xx$,1))
940 v2=val(right$(xx$,1)):l=v1:r=v2:gosub3450:gosub3330
950 rem **check who plays next**
960 pt=pt+1
970 ifpt=1thenn$="max":goto1150
980 ifop=1andpt=2thenpt=3
990 ifpt=2thenn$="joe":goto1660
1000 ifpt=3then1030
1010 ifpt>3thenpt=1:goto970
1020 rem **you move routine**
1030 xx$="":gosub2420:cp=0
1040 rw=12:gosub2380:print"[158]enter your":print"move":sys39270
1050 g$=chr$(peek(252)):g$=g$+chr$(peek(253))
1060 ifleft$(g$,1)="d"thengosub3620:gosub2900:goto1120
1070 g=val(g$):ifg<1org>d2thengosub3760:goto1030
1080 xx$=m$(g):l=val(left$(xx$,1)):r=val(right$(xx$,1))
1090 ifl<>v1andl<>v2andr<>v1andr<>v2thengosub3760:goto1030
1100 m$(g)="":gosub3450:gosub2530:gosub3270:gosub1510:ifd2=0then3790
1110 goto960
1120 ifch=1thench=0:gosub2420:goto960
1130 ifch=0then1030
1140 rem **max's move routine**
1150 rw=12:gosub2380:print"[158]max to":print"move":fort=1to1000:next
1160 xx$="":fori=1to11:pd$(i)="":ng$(i)="":q(i)=0:next:c=1:v=1:ck=0
1170 fori=1tob2:l=val(left$(c$(i),1)):r=val(right$(c$(i),1))
1180 ifl=v1orr=v1thenpd$(c)=c$(i):c=c+1:goto1210
1190 ifl=v2orr=v2thenpd$(c)=c$(i):c=c+1:goto1210
1200 ng$(v)=c$(i):v=v+1
1210 next:c=c-1:v=v-1
1220 ifpd$(1)=""thengosub3010:goto1290
1230 ifc=1thenpp=1:xx$=pd$(pp):gosub2070:gosub3450:goto1270
1240 ifle=1then1260
1250 ifle=2then1310
1260 pp=int(c*rnd(0))+1:xx$=pd$(pp):gosub2070:gosub3450
1270 ifb2=0then3830
1280 goto960
1290 ifch=1thench=0:gosub2420:goto960
1300 ifch=0then1160
1310 iflc=10andrc=10then1390
1320 fora=1toc:l=val(left$(pd$(a),1)):r=val(right$(pd$(a),1))
1330 ifl=v1andr=lcthenq(a)=10
1340 ifl=v2andr=rcthenq(a)=10
1350 ifr=v1andl=lcthenq(a)=q(a)+10
1360 ifr=v2andl=rcthenq(a)=q(a)+10
1370 ifq(a)=20thenpp=a:xx$=pd$(a):gosub2070:gosub3450:goto1270
1380 next
1390 fora=1toc:l(a)=val(left$(pd$(a),1)):r(a)=val(right$(pd$(a),1))
1400 fori=1tov:ll(i)=val(left$(ng$(i),1)):rr(i)=val(right$(ng$(i),1))
1410 ifl(a)=v1andr(a)=ll(i)orr(a)=rr(i)thenq(a)=q(a)+5
1420 ifr(a)=v1andr(a)=ll(i)orr(a)=rr(i)thenq(a)=q(a)+5
1430 ifl(a)=v2andr(a)=ll(i)orr(a)=rr(i)thenq(a)=q(a)+5
1440 ifr(a)=v2andr(a)=ll(i)orr(a)=rr(i)thenq(a)=q(a)+5
1450 next:next
1460 fora=1toc:lt=val(left$(pd$(a),1)):rt=val(right$(pd$(a),1))
1470 q(a)=q(a)+lt+rt:next:lc=0:rc=0:pc=0:fora=1toc:tq=q(a)+l(a)+r(a)
1480 ifpc<tqthenpc=tq:pp=a
1490 next:xx$=pd$(pp):gosub2070:gosub3450:goto1270
1500 rem **position your domino**
1510 ifv1=v2andl=rthengosub2320:gosub2420:return
1520 ifl=v1andr=v2then1550
1530 ifr=v1andl=v2then1550
1540 gosub2320:goto1640
1550 ifd2=0andl=v1thenv2=l:v3=r:v4=l:gosub3350:goto1640
1560 ifd2=0andl=v2thenv1=l:v3=l:v4=r:gosub3370:goto1640
1570 gosub2420:print"[158][145][145][145]"gu$(l)"up":print"or "gu$(r):print" up "
1580 gosub3730:sys39270:sd$=chr$(peek(252)):sd=val(sd$)
1590 ifsd<>landsd<>rthen1570
1600 ifsd=landl=v1thenv2=l:v3=r:v4=l:gosub3350:goto1640
1610 ifsd=landl=v2thenv1=l:v3=l:v4=r:gosub3370:goto1640
1620 ifsd=randr=v1thenv2=r:v3=l:v4=r:gosub3350:goto1640
1630 ifsd=randr=v2thenv1=r:v3=r:v4=l:gosub3370
1640 gosub2420: return
1650 rem **joe's move routine**
1660 rw=12:gosub2380:print"[158]joe to":print"move":fort=1to1000:next
1670 xx$="":fori=1to11:pd$(i)="":ng$(i)="":q(i)=0:next:c=1:v=1:cj=0
1680 fori=1tog2:l=val(left$(h$(i),1)):r=val(right$(h$(i),1))
1690 ifl=v1orr=v1thenpd$(c)=h$(i):c=c+1:goto1720
1700 ifl=v2orr=v2thenpd$(c)=h$(i):c=c+1:goto1720
1710 ng$(v)=h$(i):v=v+1
1720 next:c=c-1:v=v-1
1730 ifpd$(1)=""thengosub3070:goto1800
1740 ifc=1thenpp=1:xx$=pd$(pp):gosub2090:gosub3450:goto1780
1750 ifle=1then1770
1760 ifle=2then1820
1770 pp=int(c*rnd(0))+1:xx$=pd$(pp):gosub2090:gosub3450
1780 ifg2=0then3830
1790 goto960
1800 ifch=1thench=0:gosub2420:goto960
1810 ifch=0then1670
1820 iflc=10andrc=10then1900
1830 fora=1toc:l=val(left$(pd$(a),1)):r=val(right$(pd$(a),1))
1840 ifl=v1andr=lcthenq(a)=10
1850 ifl=v2andr=rcthenq(a)=10
1860 ifr=v1andl=lcthenq(a)=q(a)+10
1870 ifr=v2andl=rcthenq(a)=q(a)+10
1880 ifq(a)=20thenpp=a:xx$=pd$(a):gosub2090:gosub3450:goto1780
1890 next
1900 fora=1toc:l(a)=val(left$(pd$(a),1)):r(a)=val(right$(pd$(a),1))
1910 fori=1tov:ll(i)=val(left$(ng$(i),1)):rr(i)=val(right$(ng$(i),1))
1920 ifl(a)=v1andr(a)=ll(i)orr(a)=rr(i)thenq(a)=q(a)+5
1930 ifr(a)=v1andr(a)=ll(i)orr(a)=rr(i)thenq(a)=q(a)+5
1940 ifl(a)=v2andr(a)=ll(i)orr(a)=rr(i)thenq(a)=q(a)+5
1950 ifr(a)=v2andr(a)=ll(i)orr(a)=rr(i)thenq(a)=q(a)+5
1960 next:next
1970 fora=1toc:lt=val(left$(pd$(a),1)):rt=val(right$(pd$(a),1))
1980 q(a)=q(a)+lt+rt:next:lc=0:rc=0:pc=0:fora=1toc:tq=q(a)+l(a)+r(a)
1990 ifpc<tqthenpc=tq:pp=a
2000 next:xx$=pd$(pp):gosub2090:gosub3450:goto1780
2010 ifv1=v2andl=rthengosub2320:gosub2420:return
2020 ifl=v1andr=v2then2050
2030 ifr=v1andl=v2then2050
2040 gosub2320:gosub2420:return
2050 ifg2=0andl=v1thenv2=l:v3=r:v4=l:gosub3350:gosub2420:return
2060 ifg2=0andl=v2thenv1=l:v3=l:v4=r:gosub3370:gosub2420:return
2070 fori=1tob2:ifc$(i)=pd$(pp)thenxx$=c$(i):c$(i)=""
2080 next:gosub2660:l=val(left$(xx$,1)):r=val(right$(xx$,1)):goto2120
2090 fori=1tog2:ifh$(i)=pd$(pp)thenxx$=h$(i):h$(i)=""
2100 next:gosub2750:l=val(left$(xx$,1)):r=val(right$(xx$,1))
2110 rem **decide where to position dom**
2120 ifl=v1andr=v2then2150
2130 ifr=v1andl=v2then2150
2140 gosub2320:goto2300
2150 ifp(r)=7andr=v2thenv2=l:v3=r:v4=l:gosub3350:goto2300
2160 ifp(r)=7andr=v1thenv1=l:v3=l:v4=r:gosub3370:goto2300
2170 ifp(l)=7andl=v2thenv2=r:v3=l:v4=r:gosub3350:goto2300
2180 ifp(l)=7andl=v1thenv1=r:v3=r:v4=l:gosub3370:goto2300
2190 ifle=1thenv1=r:v3=r:v4=l:gosub3370:goto2300
2200 aa=p(l):ifaa>=p(r)andl=v1thenv2=l:v3=r:v4=l:gosub3350:goto2300
2210 ifaa>=p(r)andl=v2thenv1=l:v3=l:v4=r:gosub3370:goto2300
2220 ifaa>=p(r)andr=v1thenv2=r:v3=l:v4=r:gosub3350:goto2300
2230 ifaa>=p(r)andr=v2thenv1=r:v3=r:v4=l:gosub3370:goto2300
2240 ifaa<p(r)andr=v1thenv1=l:v3=l:v4=r:gosub3370:goto2300
2250 ifaa<p(r)andr=v2thenv2=l:v3=r:v4=l:gosub3350:goto2300
2260 ifl=v1thenv2=l:v3=r:v4=l:gosub3370:goto2300
2270 ifl=v2thenv2=l:v3=l:v4=r:gosub3350:goto2300
2280 ifr=v1thenv2=r:v3=l:v4=r:gosub3370:goto2300
2290 ifr=v2thenv1=r:v3=r:v4=l:gosub3350
2300 ifpt=1thengosub3290:return
2310 ifpt=2thengosub3310:return
2320 ifl=v1thenv1=r:v3=r:v4=l:gosub3370:goto2360
2330 ifl=v2thenv2=r:v3=l:v4=r:gosub3350:goto2360
2340 ifr=v1thenv1=l:v3=l:v4=r:gosub3370:goto2360
2350 ifr=v2thenv2=l:v3=r:v4=l:gosub3350
2360 return
2370 rem **set up row**
2380 rw=rw+1:ee$=left$(rw$,rw):printee$;:return
2390 rem **clear centre of screen**
2400 rw=11:gosub2380:fori=1to4:printleft$(cl$,33):next:return
2410 rem **clear left centre of screen**
2420 rw=11:gosub2380:fora=1to3:printleft$(cl$,10):next:return
2430 rem **play your dom with sound**
2440 m=1:pokell,val(left$(m$(m),1)):pokerr,val(right$(m$(m),1)):syso1:gosub3710
2450 m=m+1:pokell,val(left$(m$(m),1)):pokerr,val(right$(m$(m),1)):syso2:gosub3710
2460 ifm>d2-1thenreturn
2470 goto2450
2480 rem **play max's dom with sound**
2490 sysc1:gosub3710:forp=1tob2-1:sysc2:gosub3710:next:gosub2850:return
2500 rem **play joe's dom with sound**
2510 sysq1:gosub3710:forp=1tog2-1:sysq2:gosub3710:next:return
2520 rem **remove one of your dom**
2530 d2=d2-1:ifd2=0thenrw=15:gosub2380:fora=1to9:printleft$(cl$,33):next:return
2540 i=1:fora=1to(d2+1):ifm$(a)=""then2560
2550 zz$(i)=m$(a):i=i+1
2560 next
2570 fora=1to11:m$(a)="":next:fora=1tod2:m$(a)=zz$(a):next
2580 rw=15:gosub2380:fori=1to9:printleft$(cl$,34):next
2590 printleft$(cl$,34);""
2600 m=1:pokell,val(left$(m$(m),1)):pokerr,val(right$(m$(m),1)):syso1
2610 ifd2=1thengosub3240:return
2620 m=m+1:pokell,val(left$(m$(m),1)):pokerr,val(right$(m$(m),1)):syso2
2630 ifm>d2-1thengosub3240:return
2640 goto2620
2650 rem **remove one of max's dom**
2660 b2=b2-1:ifb2=0thenprint"";:fora=1to5
2670 ifb2=0thenprint""left$(cl$,24):next:return
2680 i=1:fora=1to(b2+1):ifc$(a)=""then2700
2690 zz$(i)=c$(a):i=i+1
2700 next
2710 fora=1to11:c$(a)="":next:fora=1tob2:c$(a)=zz$(a):next
2720 print"";:fora=1to5:print""left$(cl$,24):next:sysc1:ifb2=1thenreturn
2730 forp=1tob2-1:sysc2:next:gosub2850:return
2740 rem **remove one of joe's dom**
2750 g2=g2-1:ifg2=0thenprint"":fora=1to5
2760 ifg2=0thenprint""left$(cl$,24):next:return
2770 i=1:fora=1to(g2+1):ifh$(a)=""then2790
2780 zz$(i)=h$(a):i=i+1
2790 next
2800 fora=1to11:h$(a)="":next:fora=1tog2:h$(a)=zz$(a):next
2810 print"":fora=1to5:print""left$(cl$,24):next
2820 sysq1:ifg2=1thenreturn
2830 forp=1tog2-1:sysq2:next:gosub2850:return
2840 rem **print nos for computer dom**
2850 print" "
2860 dn=b2:ifg2>b2thendn=g2
2870 rw=5:gosub2380:print"";:fora=1todn:a$=str$(a)
2880 a$=right$(a$,(len(a$)-1)):printa$" ";:next:return
2890 rem **routine if you cant play**
2900 lc=v1:rc=v2:ifd2<11then2950
2910 xx$="out[146]":gosub3270:cp=1:ch=1
2920 ifop=1andcp=1andck=1then3980
2930 ifcp=1andck=1andcj=1then3980
2940 gosub3710:gosub3710:return
2950 iftd=28then2910
2960 a=int(28*rnd(0)+1):ifs$(a)=""then2960
2970 d2=d2+1:m$(d2)=s$(a):s$(a)="":td=td+1:gosub3390
2980 pokell,val(left$(m$(d2),1)):pokerr,val(right$(m$(d2),1)):print"[152]":syso2
2990 gosub3710:gosub3240:return
3000 rem **routine if max cant play**
3010 ifb2<11then3110
3020 xx$="out[146]":gosub3290:ck=1:ch=1
3030 ifop=1andcp=1andck=1then3980
3040 ifck=1andcp=1andcj=1then3980
3050 gosub3710:gosub3710:gosub2860:return
3060 rem **routine if joe cant play**
3070 ifg2<11then3170
3080 xx$="out[146]":gosub3310:cj=1:ch=1
3090 ifck=1andcp=1andcj=1then3980
3100 gosub3710:gosub3710:gosub2860:return
3110 iftd=28then3020
3120 a=int(28*rnd(0)+1):ifs$(a)=""then3120
3130 rem **add dom to max's hand**
3140 b2=b2+1:c$(b2)=s$(a):s$(a)="":td=td+1:gosub3390
3150 print"[152]":sysc2
3160 gosub3710:return
3170 iftd=28then3080
3180 a=int(28*rnd(0)+1):ifs$(a)=""then3180
3190 rem **add dom to joe's hand**
3200 g2=g2+1:h$(g2)=s$(a):s$(a)="":td=td+1:gosub3390
3210 print"[152]":sysq2
3220 gosub3710:return
3230 rem **nos for your dominoes**
3240 rw=24:gosub2380:printtab(1)"1 ";:ifd2=1thenreturn
3250 fori=2tod2:printi;:next:return
3260 rem ** print your dom value in column**
3270 rw=mr:mr=mr+1:gosub2380:print"":printtab(36)xx$:return
3280 rem **print max's dom value in column**
3290 rw=cr:cr=cr+1:gosub2380:print"[150]":printtab(30)xx$:return
3300 rem **print joe's dom value in column**
3310 rw=gr:gr=gr+1:gosub2380:print"[158]":printtab(33)xx$:return
3320 rem **print centre dominoe**
3330 pokell,v1:pokerr,v2:syscd:gosub3710:return
3340 rem **print centre right dominoe**
3350 pokell,v3:pokerr,v4:syscc:gosub3710:return
3360 rem **print centre left dominoe**
3370 pokell,v3:pokerr,v4:syscl:gosub3710:return
3380 rem **print no of dominoes left**
3390 i=28-td:ifi<0theni=0
3400 print" ":i$=str$(i)
3410 i$=right$(i$,(len(i$)-1))
3420 iflen(i$)=1theni$="0"+i$
3430 print"[156]"i$:return
3440 rem **keep check on dominoes played**
3450 r=val(right$(xx$,1)):l=val(left$(xx$,1))
3460 ifr=0thenp(0)=p(0)+1
3470 ifr=1thenp(1)=p(1)+1
3480 ifr=2thenp(2)=p(2)+1
3490 ifr=3thenp(3)=p(3)+1
3500 ifr=4thenp(4)=p(4)+1
3510 ifr=5thenp(5)=p(5)+1
3520 ifr=6thenp(6)=p(6)+1
3530 ifl=0thenp(0)=p(0)+1
3540 ifl=1thenp(1)=p(1)+1
3550 ifl=2thenp(2)=p(2)+1
3560 ifl=3thenp(3)=p(3)+1
3570 ifl=4thenp(4)=p(4)+1
3580 ifl=5thenp(5)=p(5)+1
3590 ifl=6thenp(6)=p(6)+1
3600 return
3610 rem **check if you can play**
3620 ifle<>1thenreturn
3630 fora=1tod2:l=val(left$(m$(a),1)):r=val(right$(m$(a),1))
3640 ifl=v1orr=v1then3680
3650 ifl=v2orr=v2then3680
3660 next
3670 return
3680 fori=1to3:gosub2420:rw=12:gosub2380:print"you can":print" play[158]"
3690 gosub3760:next:fora=1to1000:next:goto1030
3700 rem **sound routines**
3710 forx=sstoss+24:pokex,0:next:pokevo,15:pokead,5:pokesr,5:pokewf,17
3720 fortz=1to4:pokewf,130:pokehf,33:pokelf,33:pokehf,0:pokelf,o:next:return
3730 fora=1to3:pokevo,15
3740 pokewf,0:pokelf,0:pokehf,0:pokead,0:pokesr,240:pokewf,17
3750 pokehf,150:pokewf,0:poke53280,0:next:return
3760 pokevo,15:pokewf,0:pokelf,0:pokehf,0:pokead,0:pokesr,240:pokewf,17
3770 forz=60to0step-1:pokehf,z:next:return
3780 rem **you have won**
3790 rw=18:gosub2380:printee$tab(15)"well done":printtab(16)"you win"
3800 rw=24:gosub2380:print" "
3810 w=0:f=17:t=1:goto3890
3820 rem **max or joe wins**
3830 ifb2=0thenrw=3:gosub2380:printee$tab(15)"hard luck"
3840 ifb2=0thenprinttab(16)"max wins"
3850 ifop=2andg2=0thenrw=8:gosub2380:printee$tab(15)"hard luck"
3860 ifop=2andg2=0thenprinttab(16)"joe wins"
3870 w=17:f=0:t=-1:goto3890
3880 rem **end of game sound**
3890 pokevo,15:pokewf,0:pokess,0:pokehf,0:pokead,0:pokesr,240:pokewf,33
3900 forz=wtofstept:poke53280,z:fora1=1to15:pokehf,a*a1:next:next
3910 pokewf,0:poke53280,0:rw=23:gosub2380
3920 printtab(5)"[158] do you want another game: [146] y":printtab(31)"[145]";:inputa$
3930 ifleft$(a$,1)="y"thenpoke251,do:poke252,le:poke253,op
3940 ifleft$(a$,1)="y"thenclr:gosub4430:gosub4520:goto220
3950 ifleft$(a$,1)="n"thenstop
3960 print"[145][145]":goto3920
3970 rem **stitched game**
3980 c1=0:c2=0:v1=0:v2=0:j1=0:j2=0
3990 print"[147]";:fora=0to8:printtab(2)do$(a):next
4000 printtab(14)"stitched game"
4010 ifop=1thenrw=15:gosub2380:print"max"spc(31)"you":goto4030
4020 rw=15:gosub2380:print"max"spc(14)"joe"spc(14)"you"
4030 tt=b2:ifd2>ttthentt=d2
4040 ifg2>ttthentt=g2
4050 fora=1tott:c1=c1+val(left$(c$(a),1)):c2=c2+val(right$(c$(a),1))
4060 ifc$(a)=""thenc$(a)=" "
4070 print"[158]"c$(a)spc(14);
4080 ifop=2thenj1=j1+val(left$(h$(a),1)):j2=j2+val(right$(h$(a),1))
4090 ifop=2andh$(a)=""thenh$(a)=" "
4100 ifop=2thenprinth$(a);spc(14);
4110 ifop=1thenprintspc(17);
4120 v1=v1+val(left$(m$(a),1)):v2=v2+val(right$(m$(a),1))
4130 ifm$(a)=""thenm$(a)=" "
4140 printm$(a):next:goto4210
4150 fora=1tott:c1=c1+val(left$(c$(a),1)):c2=c2+val(right$(c$(a),1))
4160 ifc$(a)=""thenc$(a)=" "
4170 print"[158]"c$(a)spc(31);
4180 v1=v1+val(left$(m$(a),1)):v2=v2+val(right$(m$(a),1))
4190 ifm$(a)=""thenm$(a)=" "
4200 printm$(a):next
4210 ifop=2thenrw=11:gosub2380:print"max's"spc(11)"joe's"spc(13)"your"
4220 ifop=1thenrw=11:gosub2380:print"max's"spc(29)"your"
4230 ifop=2thenprint"points"spc(10)"points"spc(11)"points"
4240 ifop=1thenprint"points"spc(27)"points"
4250 s1=c1+c2:s2=j1+j2:s3=v1+v2
4260 ifop=2thenprint""s1;spc(16-len(str$(s1)));s2;spc(16-len(str$(s2)))s3
4270 ifop=1thenprint" "s1;spc(32-len(str$(s1)));s3:s2=1000
4280 fort=1to10
4290 ifs1<s2ands1<s3thenn$="max":goto4360
4300 ifs2<s1ands2<s3thenn$="joe":goto4360
4310 ifs3<s1ands3<s2thenn$="you":goto4360
4320 ifs1=s2ands2=s3thenrw=14:gosub2380:printtab(16)"we draw":goto4410
4330 ifs1=s2thenrw=14:gosub2380:printtab(11)"max and joe draw":goto4410
4340 ifs1=s3thenrw=14:gosub2380:printtab(11)"max and you draw":goto4410
4350 ifs2=s3thenrw=14:gosub2380:printtab(11)"joe and you draw":goto4410
4360 rw=14:gosub2380:printtab(15)""n$" wins"
4370 ifn$="you"thenprinttab(22)"[145] "
4380 fora=1to200:next
4390 printtab(15)"[145] ":next:printtab(15)"[145]"n$" wins"
4400 ifn$="you"thenprinttab(22)"[145] "
4410 rw=23:gosub2380:goto3920
4420 rem **set up variables etc**
4430 do$(0)="[176][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][174]"
4440 do$(1)="[221] [213][195][201][178] [178][176][195][201][213][178][201][176][195][201][178][213][195][201][176][201][178][176][195][201][178] [178][178][176][195][201] [221]"
4450 do$(2)="[221][158] [221] [171][195][179][171][195][179][221][221][221][171][195][203][221][221][221][221][221][221][221][173][195][174][171][195][179][221][171][195][203] [221]"
4460 do$(3)="[221] [202][195][203][177] [177][177] [177][177] [177][177] [177][202][195][203][177][202][189][173][195][189][177] [177][177][177] [221]"
4470 do$(4)="[221] [221]"
4480 do$(5)="[221] [176][195][201][213][195][201][213][178][201][213][174][176][201][178][213][195][201][213][195][201][176][195][174] [221]"
4490 do$(6)="[221][158] [221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][221][171][195] [173][195][174] [221]"
4500 do$(7)="[221] [173][195][203][202][195][203][177] [177][173][189][177][173][189][202][195][203][173][195][189][173][195][189] [221]"
4510 do$(8)="[173][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][189][159]":return
4520 gu$(0)="blank ":gu$(1)="one ":gu$(2)="two ":gu$(3)="three "
4530 gu$(4)="four ":gu$(5)="five ":gu$(6)="six "
4540 rw$=""
4550 cl$=" "
4560 dims$(28),c$(11),m$(11),h$(11),xx$(11),pd$(11),ng$(11),q$(11),q(11)
4570 ss=54272:lf=ss:hf=ss+1:ad=ss+5:sr=ss+6:wf=ss+4:vo=ss+24:h3=ss+15:l3=ss+14
4580 c1=39150:c2=39185:o1=38160:o2=38220:cd=38582:ll=251:rr=252
4590 cc=39011:cl=38992:q1=39210:q2=39245
4600 s$(1)="0-0":s$(2)="0-1":s$(3)="0-2":s$(4)="0-3":s$(5)="0-4":s$(6)="0-5"
4610 s$(7)="0-6":s$(8)="1-1":s$(9)="1-2":s$(10)="1-3":s$(11)="1-4":s$(12)="1-5"
4620 s$(13)="1-6":s$(14)="2-2":s$(15)="2-3":s$(16)="2-4":s$(17)="2-5"
4630 s$(18)="2-6":s$(19)="3-3":s$(20)="3-4":s$(21)="3-5":s$(22)="3-6"
4640 s$(23)="4-4":s$(24)="4-5":s$(25)="4-6":s$(26)="5-5":s$(27)="5-6"
4650 s$(28)="6-6":return
4660 rem **instructions**
4670 print"[147] instructions [146][159]"
4680 print"normal domino rules apply...........
4690 [153]"you will be playing with a double six
4700 print"pack and dealt with the number of
4710 [153]"dominoes you select between 5 and 9.
4720 print"the computer will check which player
4730 [153]"holds the highest double and make the
4740 print"the first move.
4750 [153]"to make subsequent moves enter the
4760 print"number of the selected domino and
4770 [153]"press return. if you are unable to play
4780 print"additional dominoes can be drawn from
4790 [153]"the pool by entering 'd' and return.
4800 print"'d' should be used even if there are"
4810 print"no dominoes left in the pool."
4820 print"all dominoes played will be displayed
4830 [153]"on the right of the screen under the
4840 print"correct column.
4850 [153]"if you hold eleven dominoes or the
4860 print"pool is empty you will miss that turn.
4870 [153]"sys press return to continue wait
4880 geta$:ifa$=""then4880
4890 ifa$<>chr$(13)then4880
4900 print"[147][159]the computer will automatically make
4910 [153]"moves for max and joe.
4920 print"if your move can alter the state of the
4930 [153]"game. i.e. your selected domino can
4940 print"be played either way you will be asked
4950 [153]"which side up. the number you select
4960 print"will then be the value at both ends.
4970 [153]"if the game is 'stitched' (no player
4980 print"wins) the winner is decided by the
4990 [153]"lowest spot total of the dominoes on
5000 print"the table at the end of the game.
5010 [153]"sys press return for first game wait
5020 geta$:ifa$=""then5020
5030 ifa$<>chr$(13)then5020
5040 goto220
5050 rem **redifine characters**
5060 i=49152
5070 read a:if a=256 then5100
5080 poke i,a:i=i+1:goto5070
5090 data 0,3,7,7,7,7,3,256
5100 i=49376
5110 read a:if a=256 then5140
5120 poke i,a:i=i+1:goto5110
5130 data 0,192,224,224,224,224,192,256
5140 i=49393
5150 read a:if a=256 then return
5160 poke i,a:i=i+1:goto5150
5170 data 0,0,0,0,60,126,126,126
5180 data 126,60,0,0,0,0,256