home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 1 #9
/
utv1n9s1.d64
/
matrix
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
15KB
|
412 lines
120 :
130 rem main program
140 :
150 rem title screen
160 poke53280,0:poke53281,0:print"[147]"chr$(8)chr$(142);
170 print" [176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174]
180 [153]" (NULL)getlogwait* wait(NULL)def coslogwait (NULL)syslogrnd*waitcos(NULL)printget*rndwaitrnd(NULL)cont rnd*wait (NULL)opengetwaitgetgetwaitget(NULL)"
190 [153]" (NULL)get** wait(NULL)defgetlogcoswaitget(NULL)sys getwaitget (NULL)printgetlogcoswaitcos(NULL)cont getwaitget (NULL)open rnd*wait (NULL)"
200 [153]" (NULL)getwaitget wait(NULL)defgetwaitgetgetwaitget(NULL)sys getwaitget (NULL)printget*logwait (NULL)cont getwaitget (NULL)open**rndwaitrnd(NULL)"
210 [153]" (NULL)logcos newwait(NULL)deflogcoslogcos(NULL)sys logcos (NULL)printlogcoslogcos(NULL)cont newnewwait (NULL)openlogcoslogcos(NULL)"
220 [153]" /tantantantan>tantantantan>tantantantan>tantantantan>tantantantan>tantantantanexp"
230 [153]""[163]14)"ortan=tan=tan=tan=tan^":[153][163]14)"(NULL)epeekw(NULL)k(NULL)s(NULL)m(NULL)
240 printtab(14)"[171][192][219][192][219][192][219][192][219][192][179]":printtab(14)"[221]o[221]n[221]r[221]e[221]a[221]"
250 printtab(14)"[171][192][219][192][219][192][219][192][219][192][179]":printtab(14)"[221]h[221]r[221]t[221]l[221]r[221]"
260 printtab(14)"[171][192][219][192][219][192][219][192][219][192][179]":printtab(14)"[221]v[221]d[221]u[221]p[221]c[221]"
270 printtab(14)"[171][192][219][192][219][192][219][192][219][192][179]":printtab(14)"[221]i[221]c[221]v[221]h[221]f[221]"
280 printtab(14)"[173][192][177][192][177][192][177][192][177][192][189]":print""tab(7)"[159](c) 1987 by james speers"
290 print" published by softdisk publishing, inc.";
300 fori=1to10:readx:poke55671+x,1:forj=1to300:nextj,i:tb=ti
310 rem dimensions-initialize
320 diml$(300),wl$(6,40),m$(5,5),s1(25),s2(25),lo(25),pi$(5,20)
330 poke251,19:poke252,0:poke253,3:poke254,18
350 of$=chr$(146):yr=782:pr=49180:l1$="[221] [221] [221] [221] [221] [221]":bl$=" ":lr=253
360 lc=254:v=54272:ww=49152:wl=49163:c=55416:wd=49174:q$=chr$(34)
370 l2$="[176][192][178][192][178][192][178][192][178][192][174]":l3$="[171][192][219][192][219][192][219][192][219][192][179]":l4$="[173][192][177][192][177][192][177][192][177][192][189]"
380 ls$(2)="b"+"[221]":ls$(3)="c"+"[221]":ls$(d)="4"+"[221]":ls$(5)="e"+"[221]"
390 pokewr,18:pokewc,1:pokelr,3:pokelc,20:hr$=", r to review maze":pr=65520
400 of$=chr$(146):yr=782:pr=49180:xr=781:yr=782:sr=783
420 x=rnd(-ti):fori=0to24:readq:pokev+i,q:next
430 e$(1)="not adjacent, re-do":e$(2)="already used, re-do"
440 fori=1to300:readl$(i):next:fori=0to32:readq:pokeww+i,q:next
450 x=960:fori=0to23:readq:pokex+i,q:next:fori=24to63:pokex+i,0:next
460 fori=1to5:readmx(i),my(i):next
470 fori=1to5:forj=1to20:readpi$(i,j):next:next:b$="[150]"
480 lu$="[172]":ru$="[187]":ll$="[188]":rl$="[190]"
490 bb$="[162]":fori=1to37:bb$=bb$+"[162]":next:bb$=bb$+"[146]"
500 fori=1to38:tb$=tb$+"[162]":next
510 lb$="[161][146]":rb$="[161]":fori=1to36:bl$=bl$+" ":next:br$=""+bl$+"[146]"
520 cr$=" [146][157]":dl$="[157] [157][157]"+cr$:pc=65520
530 rem instructions? y or n
540 print"[147]":tr=10:br=14:lc=6:rc=32:c=10:gosub2000:r=11:c=7:gosub1780
550 print"[159]do you need instructions?":r=13:c=17:gosub1780
560 print"(y/n)":gosub1800:s1=89:s2=78
565 gosub1820
570 ongngoto565,565,2050,565,565,580,600,565,565
580 pn=1:gosub2170
590 rem get number of players
600 print"[147]"
610 tr=8:br=14:lc=12:rc=26:c=10:gosub2000:r=9:c=15:gosub1780
620 print"[159]number of":r=11:c=13:gosub1780
630 print"players (1-6)":r=13:c=19:gosub1780:print"?":gosub1780
640 gosub1800:l1=49:h1=54
645 gosub1820
650 ongngoto645,645,2050,670,645,645,645,645,645
660 rem enter player names
670 np=asc(z$)-48:fori=1tonp
680 tr=9:br=13:lc=10:rc=28:c=10:gosub2000:r=10:c=14:gosub1780
690 print"[159]player #";i:r=12:c=11:gosub1780
700 print"name:[163][163][163][163][163][163][163][163][163][163][163][163]":c=16:gosub1780
710 il=12:gosub2340:pn$(i)=in$
720 nexti:print
730 rem get length of turn
740 tr=8:br=16:lc=12:rc=25:c=10:gosub2000:r=9:c=13:gosub1780
750 print"[159]how long for":r=11:c=14:gosub1780
760 print"each turn?":r=13:c=16:gosub1780
770 print"[163][163][145] min":r=15:gosub1780:print"[163][163][145] sec"
780 r=13:c=16:gosub1780:il=2:gosub2340:ifval(in$)<0orval(in$)>59then740
790 mi=val(in$):r=15:c=16:gosub1780:il=2:gosub2340
800 ifval(in$)<0orval(in$)>59then740
810 se=val(in$):tx=3600*mi+60*se
820 gosub2410
830 rem start player's turns
840 forp=1tonp:pokewr,18:pokewc,1:poke253,3:poke254,20:ww$="":nw(p)=1
850 print"[147]":x$=pn$(p)+"'s turn":r=10:c=int((40-len(x$))/2):gosub1780
860 print"[159]"x$"[150]":r=11:gosub1780:fori=1tolen(x$):print"[163]";:next:r=13:c=13
870 gosub1780:print"[159]hit s to start[150]":r=14:gosub1780:fori=1to14:print"[163]";:next
880 getz$:ifz$=""orz$<>"s"then880
890 rem print playing screen
900 gosub2430:print"";:r=7:c=1:gosub1780:fori=1to5:forj=1to5
910 printm$(i,j)"";:nextj:print:r=r+2:gosub1780:nexti
920 rem activate sprite-set time-play
930 poke2040,15:poke53248,72:poke53249,146:poke53269,1:poke53287,5
940 tm=ti+tx:mr=3:mc=3
950 rem read joystick
960 forz=1to30:nextz:jy=peek(56320):if(jyand16)=0thengosub2510:goto1030
970 jy=jyand15:if(jyand1)=0thenmr=mr-1:ifmr<1thenmr=1
980 if(jyand2)=0thenmr=mr+1:ifmr>5thenmr=5
990 if(jyand4)=0thenmc=mc-1:ifmc<1thenmc=1
1000 if(jyand8)=0thenmc=mc+1:ifmc>5thenmc=5
1010 poke53248,mx(mc):poke53249,my(mr)
1020 rem check function keys
1030 getz$:gosub1970:ifz$="[166]"thenprint"[147]":ds=1500:gosub2620:goto1110
1040 ifz$=""then960
1050 ifz$="[133]"thengosub2650:goto960
1060 ifz$="[134]"thengosub2680:goto960
1070 ifz$="[135]"thengosub2750:goto960
1080 ifz$="[136]"thengosub2790:goto960
1090 ifz$="[140]"then2050
1100 goto960
1110 poke53269,0:gosub2820:gosub2840:nextp
1120 print"[147]":tr=11:br=13:lc=14:rc=25:c=10:gosub2000
1130 rem mark duplicates with other players
1140 r=12:c=15:gosub1780:print"[159]scoring...":print""
1150 ifnp=1then1220
1160 forp=1tonp-1:forw=1tonw(p):cm$=wl$(p,w):ifleft$(cm$,1)="*"then1200
1170 forp2=p+1tonp:forw2=1tonw(p2):ifcm$<>wl$(p2,w2)then1190
1180 wl$(p2,w2)="*"+wl$(p2,w2):ifleft$(wl$(p,w),1)<>"*"thenwl$(p,w)="*"+wl$(p,w)
1190 nextw2,p2
1200 nextw,p
1210 rem print word lists for deletions
1220 print"[147]":poke53280,10:poke53281,6:print""
1230 forp=1tonp
1240 print"[147]":c=(40-(len(pn$(p))+7))/2:r=1:gosub1780:print""pn$(p)"'s list"
1250 r=2:gosub1780:print"[150]";:fori=1tolen(pn$(p))+7:print"[163]";:nexti
1260 poke253,4:poke254,7:fori=1tonw(p):syswl:print"";:ifi<10thenprint" ";
1270 print"";i;"[146]"wl$(p,i):ifpeek(253)=21thenpoke253,4:poke254,24
1280 next:r=21:c=3:gosub1780:printtab(12)"deletions? (y/n)";
1290 getz$:ifz$=""or(z$<>"y"andz$<>"n")then1290
1300 ifz$="n"then1340
1310 print:printtab(13)"enter number [146]";:gosub1800
1315 l1=48:h1=57:il=2:in$="":ct=0:poke204,0
1320 gosub2350:x=val(in$)
1325 if x>40 then 1340
1327 if left$(wl$(p,x),1)<>"*" then wl$(p,x)="*"+wl$(p,x)
1329 goto1240
1330 rem calculate and print scores
1340 print"[147]"
1350 c=(40-(len(pn$(p))+8))/2:r=1:gosub1780:print""pn$(p)"'s score"
1360 r=2:gosub1780:print"[150]";:fori=1tolen(pn$(p))+8:print"[163]";:nexti
1370 poke253,3:poke254,2:tb=18
1380 tl(p)=0:forw=1tonw(p):ifleft$(wl$(p,w),1)="*"thens=0:s$="0":goto1400
1390 x=len(wl$(p,w))-3:s=int((x*(x+1))/4+.55):s$=str$(s):tl(p)=tl(p)+s
1400 syswl:print""wl$(p,w);tab(tb-len(s$));s$
1410 if(peek(253))=21thenpoke253,3:poke254,22:tb=38
1420 nextw
1430 s$=str$(tl(p)):cm(p)=cm(p)+tl(p):r=22:c=2:gosub1780
1440 print"total"tab(18-len(s$));s$:r=23:c=11:gosub1780
1450 print"[150]hit c to continue[146]";
1460 getz$:ifz$=""orz$<>"c"then1460
1470 nextp
1480 rem print summary screen
1490 poke53280,6:poke53281,0:lc=3:rc=36:tr=5-int((np+1)/2):br=17+int(np/2):c=10
1500 gosub2000:tr=tr+1:br=br-1:lc=lc+1:rc=rc-1:c=3:gosub2010
1510 tr=tr+1:br=br-1:lc=lc+1:rc=rc-1:c=10:gosub2010
1520 r=tr:c=lc:gosub1780:fori=1to9+np
1530 print" [146]":r=r+