home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1987 July & August
/
rerun-1987-07-08.d64
/
pegboard
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
110 lines
1 rem pegboard 64 (c) 1986 john olsen
10 poke53280,0:poke53281,0:n%=9:m%=81:o%=80:p%=160:q%=156:r%=400:s=54272
20 poke53265,peek(53265)and239
30 print"[147][156]"chr$(142)chr$(8)tab(14)"[176][192][192][192][192][192][192][192][192][192][174]"
40 printtab(14)"[221][158]peg board[156][221]"
50 printtab(14)"[173][192][192][192][192][192][192][192][192][192][189]"
60 printtab(13)"[158]by john olsen"
70 print"[159]remove one"tab(31)"diagonal"
80 print"peg at a"tab(34)"jumps"
90 print"time, by"tab(32)"are not"
100 print"jumping"tab(32)"allowed"
110 print"over it"
120 print"with an"
130 print"adjacent"
140 print"peg"tab(31)
150 printtab(32)"you win"
160 print"use your"tab(31)"when one"
170 print"joystick"tab(31)"peg only"
180 print"in port 2"tab(32)"remains"
190 print""tab(15)"[144]+ + + + +"
200 printtab(16)"[176][192][178][192][178][192][174]"
210 printtab(15)"[144]+[221] [221] [221] [221][144]+"
220 printtab(16)"[171][192][219][192][219][192][179]"
230 printtab(11)"[144]+ + +[221] [221] [221] [221][144]+ + +"
240 printtab(12)"[176][192][178][192][219][192][219][192][219][192][219][192][178][192][174]"
250 printtab(11)"[144]+[221] [221] [221] [221] [221] [221] [221] [221][144]+"
260 printtab(12)"[171][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
270 printtab(11)"[144]+[221] [221] [221] [221] [221] [221] [221] [221][144]+"
280 printtab(12)"[171][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
290 printtab(11)"[144]+[221] [221] [221] [221] [221] [221] [221] [221][144]+"
300 printtab(12)"[173][192][177][192][219][192][219][192][219][192][219][192][177][192][189]"
310 printtab(11)"[144]+ + +[221] [221] [221] [221][144]+ + +"
320 printtab(16)"[171][192][219][192][219][192][179]"
330 printtab(15)"[144]+[221] [221] [221] [221][144]+"
340 printtab(16)"[173][192][177][192][177][192][189]"
350 printtab(15)"[144]+ + + + +"
360 print""tab(17)"[158][209][150][209][209]"
370 printtab(17)"[209][209][209]"
380 printtab(13)"[209][209][209][209][209][209][209]"
390 printtab(13)"[209][209][209] [209][209][209]"
400 printtab(13)"[209][209][209][209][209][209][209]"
410 printtab(17)"[209][209][209]"
420 printtab(17)"[209][209][209]"
430 poke53265,peek(53265)or16
440 bl=1361:l=bl
450 ll=l
460 pokes+4,0:pokes+23,0:pokes+22,0
470 p=255-(peek(56464)or128)
480 ifpand16then590
490 ifpand1thenl=l-o%
500 ifpand2thenl=l+o%
510 ifpand4thenl=l-2
520 ifpand8thenl=l+2
530 ifl=llthen470
540 ifpeek(l)=43thenl=ll:goto470
550 pokell+54272,10:ifpeek(ll)=p%thenpokell,32
560 pokel+54272,7:ifpeek(l)=32thenpokel,p%
570 gosub1050
580 goto450
590 wait56464,16
600 ifsl=.andpeek(l)=p%then450
610 ifpeek(l)=42thensl=.:pokel,m%:goto450
620 ifsl=.thensl=l:pokel,42:goto450
630 ifabs(sl-l)<>p%andabs(sl-l)<>4then450
640 ifpeek(l)<>p%then450
650 t=(sl+l)/2
660 ifpeek(t)=32then450
670 pokesl,32:pokel,m%:poket,32
680 sl=.:c=.
690 fory=.to1:forx=.to2
700 t=bl+o%*y+2*x
710 ifpeek(t)=m%thenc=c+1:goto750
720 ifpeek(t+o%)=m%thenifpeek(t+p%)=m%theny=n%:x=n%:goto750
730 ifx=.thenifpeek(t+2)=m%thenifpeek(t+4)=m%theny=n%:x=n%:goto750
740 ifx=2thenifpeek(t-2)=m%thenifpeek(t-4)=m%theny=n%:x=n%
750 next:next
760 gosub1050
770 ifx>n%ory>n%then450
780 fory=.to2:forx=.to6
790 t=bl+o%*y+2*x+q%
800 ifpeek(t)=m%thenc=c+1:goto860
810 ifpeek(t+o%)=m%thenifpeek(t+p%)=m%theny=n%:x=n%:goto860
820 ifpeek(t-o%)=m%thenifpeek(t-p%)=m%theny=n%:x=n%:goto860
830 ifpeek(t+2)=m%thenifpeek(t+4)=m%theny=n%:x=n%:goto860
840 ifpeek(t-2)=m%thenifpeek(t-4)=m%theny=n%:x=n%
850 gosub1050
860 next:next
870 ifx>n%ory>n%then450
880 fory=.to1:forx=.to2
890 t=bl+o%*y+2*x+r%
900 ifpeek(t)=m%thenc=c+1:goto940
910 ifpeek(t-o%)=m%thenifpeek(t-p%)=m%theny=n%:x=n%:goto940
920 ifx=.thenifpeek(t+2)=m%thenifpeek(t+4)=m%theny=n%:x=n%:goto940
930 ifx=2thenifpeek(t-2)=m%thenifpeek(t-4)=m%theny=n%:x=n%
940 next:next
950 ifx>n%ory>n%then450
960 pokel+54272,10
970 ifc=1thena$=" you win!":b$=a$
980 ifc>1thena$=" try again":b$=str$(c)+" left!"
990 poke781,24:poke782,6:sys65520
1000 print"[154]"a$tab(23)b$;
1010 wait56464,16:wait56464,16,16
1020 poke782,7:sys65520
1030 print" ";
1040 wait56464,16:goto360
1050 pokes,240:pokes+1,15:pokes+6,1
1060 pokes+5,8:pokes+22,104:pokes+23,2
1070 pokes+24,79:pokes+4,129
1080 forz=1to20:next:return