home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1987 January & February
/
rerun-1987-01-02.d64
/
crosswords
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
7KB
|
235 lines
10 sc=1024:v=53248:s=sc+v:cc=sc+s:sp$=" ":dn$=""
20 a=rnd(-ti/100):fori=stos+24:pokei,0:next:pokes+24,15:poke788,52
30 print"[147][144]";:poke53280,14:poke53281,14:deffnr(x)=int(rnd(1)*100)+1
40 fori=828to866:reada:pokei,a:ck=ck+a:next
50 ifck<>5301thenprint"error in data (lines 2200-2240)":end
60 i=2:gosub2090:fori=0to15
70 print""spc(11)"crosswords"
80 print""spc(11)"c[157]r[157]o[157]s[157]s[157]w[157]o[157]r[157]d[157]s"
90 printdn$spc(7)"[159]crosswords"
100 printleft$(dn$,6)spc(25)"[158]c[157]r[157]o[157]s[157]s[157]w[157]o[157]r[157]d[157]s";
110 gosub2050:poke828,i:sys829:gosub2050:next
120 fori=1to11:gosub2050:poke828,i:sys829:next:fori=stos+6:pokei,0:next
130 dimla%(100):y=0
140 readi,a:ifi<0then160
150 forj=1toi:y=y+1:la%(y)=a:next:goto140
160 fori=1to75:x=fnr(0):y=fnr(0)
170 la%(0)=la%(x):la%(x)=la%(y):la%(y)=la%(0):next
180 poke198,0:print"[147][144]this game can be played by one to eight[144] players."
190 print"how many will be playing this game? ";
200 geta$:ifa$=""then200
210 printa$:np=val(a$)
220 ifnp>0andnp<9then240
230 gosub2140:printspc(10)" not 1 to 8 - try again. [146] ^[145][145]"spc(39);:goto200
240 dimpn$(np),ll%(np,8)
250 fori=0to63:reada:poke896+i,a:next
260 fori=1tonp:print"[147][151]when player prompt appears enter your name. ";
270 print"eight(8) alphabetic characters or less."
280 ifnp=1then310
290 print"when your name appears followed by [158]code?[151]press any two ";
300 print"keys. remember which keysyou press they will be needed later."
310 open1,0:print"player #"i"name? ";:input#1,a$:close1:print
320 x=asc(left$(a$,1)+chr$(0)):ifx<65orx>90thengosub2140:goto310
330 iflen(a$)>8thenprinta$", is more than eight letters.":gosub2140:goto310
340 forj=1tolen(a$):ifmid$(a$,j,1)=chr$(32)then360
350 ifmid$(a$,j,1)>chr$(64)andmid$(a$,j,1)<chr$(91)then370
360 a$=left$(a$,j-1)+chr$(96)+mid$(a$,j+1)
370 nextj
380 iflen(a$)<8thena$=a$+chr$(96):goto380
390 pn$(i)=a$:ifnp=1then450
400 poke198,0:print" "pn$(i)"[158]code? --[146][157][157][151]";
410 geta$:ifa$=""then410
420 print" ";
430 getb$:ifb$=""then430
440 print" ":pn$(i)=pn$(i)+a$+b$:nexti
450 nt=int(40/np+.7):print"[147]"right$(dn$,9)"enter number of turns 1 to"nt"[144]";
460 open1,0:input#1,a$:close1:a$=a$+chr$(0):x=val(a$)
470 ifx<1orx>ntthengosub2140:printleft$(dn$,10)spc(30);:goto460
480 nt=x:print:print"[151]press any key to start.":poke198,0
490 geta$:ifa$=""then490
500 fori=1tonp:forj=1to8:ll%(i,j)=la%(fnr(0)):nextj,i
510 print"[147]";:i=0:gosub2090:poke828,15:sys829
520 poke2040,14:pokev+39,1:pokev,138:pokev+1,134:pokev+21,1:a$=""
530 fori=1to5:gosub2160:next:fori=1to8:a$=a$+right$(str$(i),1)+"-[157][157]"
540 next:print""spc(36)a$"";
550 printleft$(dn$,9)spc(33)"[158]score "spc(33)"rnd "spc(33)"h/score";
560 forj=1tont:forj1=1tonp:a=1
570 fori=0to280step40:pokesc+33+i,asc(mid$(pn$(j1),a,1))-64:pokecc+33+i,6
580 pokesc+38+i,ll%(j1,a):pokecc+38+i,6
590 ifnp=1then650
600 j2=j1+1:ifj2>npthenj2=1
610 pokesc+713+i,asc(mid$(pn$(j2),a,1))-64:pokecc+713+i,0
620 ck=0:ifj=ntthenifj2=1thenck=14:goto640
630 pokesc+716+i,ll%(j2,a)
640 pokecc+716+i,ck
650 a=a+1:nexti
660 printleft$(dn$,10)spc(33)""left$(str$(ll%(j1,0))+sp$,7);
670 printspc(36)"[158]"left$(str$(j)+sp$,4);
680 printspc(33)"[158]"left$(str$(ll%(0,0))+sp$,7);
690 gosub1320:ifa$<>"p"then720
700 ifnp>1thengosub840
710 goto800
720 gosub1480:ifa$="p"then700
730 ifnp>1thengosub840
740 printdn$spc(33)"[144]okay "spc(33)"[y/n]? ";
750 geta$:ifa$="n"then720
760 ifa$<>"y"then750
770 iflk=-1then800
780 gosub1030:ford=stos+6:poked,0:next:ford=1to2000:next:sys829
790 ifll%(j1,0)>ll%(0,0)thenll%(0,0)=ll%(j1,0)
800 fori=0to7:ck=peek(cc+38+i*40)and15
810 ifck=14thenll%(j1,i+1)=la%(fnr(0))
820 next
830 lk=-1:nextj1,j:goto930
840 printleft$(dn$,13)spc(33)"[144]enter "spc(33)"code. ";
850 printspc(33)"--[146] [157][157][157][157][157][157][157]";
860 geta$:ifa$=""then860
870 print" ";
880 getb$:ifb$=""then880
890 print" ";
900 a$=a$+b$
910 ifa$<>right$(pn$(j2),2)thengosub2140:printdn$"";:goto850
920 printdn$spc(33)" ";spc(33)" ";:return
930 pokev+21,0:pokev+16,0
940 print"";:fori=1to24:printspc(33)left$(sp$,7);:next:printspc(33)" ";
950 printleft$(dn$,11)spc(33)" press "spc(33)"any key"spc(33)"to see";
960 printspc(33)"scores";:poke198,0
970 geta$:ifa$=""then970
980 print"[147]":fori=1tonp:printleft$(pn$(i),8)">"ll%(i,0):print:next
990 print"another game [y/n]?":poke198,0
1000 geta$:ifa$="y"thenrun
1010 ifa$<>"n"then1000
1020 sys2048
1030 gosub1290:ifpeek(sl)=32thensl=sl-d1
1040 ifpeek(p1-d1/2)<>c1andpeek(p1-d1)<>32thenfl=fl+.5
1050 ifpeek(p1+d1/2)<>c1andpeek(p1+d1)<>32thenfl=fl+.5
1060 iffl>0thenfl=0:goto1080
1070 fl=dx:dx=dy:dy=fl:gosub1290
1080 ifpeek(p1-d1/2)<>c1andpeek(p1-d1)<>32thenp1=p1-d1:fl=fl+.5:goto1080
1090 fori=p1tosl-d1stepd1
1100 if(peek(i+s)and15)+(peek(i+s+d1)and15)=30thenfl=fl+1:goto1120
1110 next
1120 fori=p1toslstepd1
1130 if(peek(i+s)and15)=15then1160
1140 ifpeek(i-d2/2)<>c2andpeek(i-d2)<>32thend2=-d2:goto1190
1150 ifpeek(i+d2/2)<>c2andpeek(i+d2)<>32then1190
1160 gosub1260
1170 next:iffl>.5andlu>1thenfori=sptoslstepd1:gosub1250:next
1180 fl=0:return
1190 p2=i:ifd2>0then1230
1200 ifpeek(i+d2/2)<>c2andpeek(i+d2)<>32theni=i+d2:goto1200
1210 ifi<p2thengosub1260:i=i-d2:goto1210
1220 d2=-d2
1230 ifpeek(i)<>32thengosub1260:ifpeek(i+d2/2)<>c2theni=i+d2:goto1230
1240 i=p2:goto1160
1250 if(peek(i+s)and15)=15or(peek(i+s)and15)=0thenreturn
1260 ll%(j1,0)=ll%(j1,0)+1:pokei+s,(peek(i+s)and15)+1
1270 printleft$(dn$,10)spc(33)""left$(str$(ll%(j1,0))+sp$,7);
1280 gosub2180:return
1290 c1=64:c2=93:d1=80:d2=2:p1=sp:fl=0
1300 ifdxthenc1=93:c2=64:d1=2:d2=80
1310 return
1320 poke198,0:printdn$spc(33)"cursor "spc(33)" keys. ";
1330 printspc(33)"dir h/v[146]"spc(33)"p=pass [146]";:goto1350
1340 gosub1930:iffl=1thengosub2140:fl=0
1350 geta$:ifa$=""then1350
1360 dx=16*(a$="[157]")-16*(a$=""):dy=16*(a$="[145]")-16*(a$=""):ifdxordythen1340
1370 ifa$="p"thenfori=0to7:pokecc+38+i*40,14:next:goto1470
1380 ifa$<>"h"anda$<>"v"thengosub2140:goto1350
1390 gosub2010:ifpeek(sl)<>32thengosub2140:goto1350
1400 dx=-16*(a$="h"):dy=-16*(a$="v"):sp=sl:ifll%(0,0)=0thenlk=0:goto1470
1410 ifdxthen1450
1420 ifpeek(sp-40)=64then1470
1430 ifpeek(sp-80)<>32thenlk=0
1440 goto1470
1450 ifpeek(sp-1)=93then1470
1460 ifpeek(sp-2)<>32thenlk=0
1470 fl=0:printdn$spc(33)left$(sp$,7)spc(33)""left$(sp$,7);:return
1480 lu=0:poke198,0:printdn$spc(33)"spell "spc(33)" [1-8] ";:
1490 printspc(33)"d[146]elete "spc(33)"return [146]";
1500 geta$:ifa$=""then1500
1510 ifa$=chr$(13)then1630
1520 ifa$="d"then1770
1530 ifval(a$)<1orval(a$)>8orfl=1thengosub2140:goto1500
1540 ck=peek(cc+38+40*(val(a$)-1))and15
1550 ifck=14thengosub2140:goto1500
1560 pokesl,peek(sc+38+40*(val(a$)-1)):pokesl+s,0:lu=lu+1
1570 pokecc+38+40*(val(a$)-1),14:iflk=-1thengosub1660
1580 gosub1930
1590 iffl=1then1500
1600 ifpeek(sl)=32then1500
1610 iflk=-1thenlk=sl-sp+1
1620 goto1580
1630 iflk=-1thengosub2140:goto1500
1640 ifsp=slandpeek(sl)=32thengosub2140:goto1500
1650 fl=0:printdn$spc(33)left$(sp$,7)spc(33)""left$(sp$,7);:return
1660 ifdxthen1720
1670 ifpeek(sl-1)=93then1690
1680 ifpeek(sl-2)<>32thenlk=sl-sp+1:goto1760
1690 ifpeek(sl+1)=93then1740
1700 ifpeek(sl+2)<>32thenlk=sl-sp+1
1710 goto1760
1720 ifpeek(sl-40)=64then1740
1730 ifpeek(sl-80)<>32thenlk=sl-sp+1:goto1760
1740 ifpeek(sl+40)=64then1760
1750 ifpeek(sl+80)<>32thenlk=sl-sp+1
1760 return
1770 poke198,0:printdn$spc(33)"[153]w[146]ord "spc(33)"l[146]etter ";:
1780 printspc(33)"n[146]one "spc(33)" [146]";
1790 dx=-dx:dy=-dy:lu=lu-1
1800 geta$:ifa$=""then1800
1810 ifa$="n"then1910
1820 ifa$<>"w"anda$<>"l"thengosub2140:goto1800
1830 ifpeek(sl)<>32then1860
1840 ifsl=spthen1910
1850 gosub1930
1860 ck=peek(sl+s)and15:ifck=15then1840
1870 a=peek(sl):pokesl,32:ifsl-sp+1=lkthenlk=-1
1880 fori=1062to1342step40:ck=peek(i+s)and15
1890 ifpeek(i)=aandck=14thenpokei+s,6:pokesl+s,14:i=1342
1900 next:ifa$="w"thenlk=-1:lu=0:goto1840
1910 fl=0:dx=-dx:dy=-dy:ifa$="w"thengosub1320:ifa$="p"then1650
1920 goto1480
1930 ifdxthen1960
1940 y=peek(v+1)+dy:ify<50ory>245the