home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun: Game Pak
/
rerun-gamepak
/
snakes
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
74 lines
10 poke53281,0:poke53280,0:cl(0)=3:cl(1)=13:cl(2)=4:cl(3)=7:cr(1)=81:cr(0)=87
20 dr(0)=40:dr(1)=39:dr(2)=-1:dr(3)=-41:dr(4)=-40:dr(5)=-39:dr(6)=1:dr(7)=41
30 dimin(255,3):c=54272:cr(2)=42:cr(3)=90
35 gosub2050
36 rem ***********************
40 print"[147][159] "
45 forx=1to20
50 print" [146] [146]"
60 next
70 print"[159] "
80 rem ***********************
90 forx=0to3
100 pl(x)=1024+int(rnd(1)*20)*40+int(rnd(1)*38)
110 ifpeek(pl(x))<>32then100
120 pokepl(x),cr(x):pokepl(x)+c,cl(x)
130 next
200 rem **********************
210 fortu=0to3
220 cl=cl(tu):cr=cr(tu):pl=pl(tu):mv=0
230 gosub2000
240 ifsi=255thengosub2500::goto1000
250 ifin(si,tu)thenpl=pl+in(si,tu):pokepl,cr(tu):pokepl+c,cl:goto230
260 gosub2040:print"what direction, player"tu+1;:poke1930,cr:poke1930+c,cl
265 ifsn(tu)>2then500
266 poke198,0
270 geta$:ifa$=""then270
280 x=(a$="b")+(a$="h")*2+(a$="y")*3+(a$="u")*4+(a$="i")*5+(a$="j")*6+(a$="m")*7
285 x=abs(x)
290 ifx>0ora$="n"then305
300 goto270
305 if(siand2^x)=(2^x)then270
310 in(si,tu)=dr(x):pl=pl+dr(x)
320 pokepl,cr:pokepl+c,cl
330 goto1000
500 x=int(rnd(1)*8)
510 if(siand2^x)=(2^x)then500
520 goto310
1000 pl(tu)=pl:next
1010 ift=4thengoto3000
1020 t=0:goto200
2000 rem *********************
2010 si=0:forx=0to7:i=peek(pl+dr(x)):ifi=32thennext:return
2020 si=si+2^x:next:return
2030 rem *********************
2040 print"":forx=1to21:print:next:return
2050 rem *********************
2060 print"[147]":forx=1to8:print:next
2070 printspc(16)"snakes"
2080 printspc(16)"[163][163][163][163][163][163]"
2100 print"":forx=1to15:print:next:print"1. player controlled-new"
2110 print"2. player controlled-old"
2120 print"3. computer controlled-new"
2130 print"4. computer controlled-old"
2140 fory=0to3:print"":forx=1to12:print:next:print"snake"y+1"type : [157]";:poke204,0
2150 geta$:ifval(a$)=0orval(a$)>4then2150
2160 sn(y)=val(a$):printa$:poke204,1
2165 ifsn(y)=1orsn(y)=3thengosub3070
2170 next:return
2500 gosub2040:print" "
2510 gosub2040:print"player"tu+1"is trapped"
2520 t=t+1:return
3000 rem *********************
3003 gosub2040:print" ":forx=0to4:sc(x)=0:next
3005 forx=1024to1924
3010 i=peek(x)
3020 fory=0to3:ifi=cr(y)thensc(y)=sc(y)+1
3030 next:next
3040 gosub2040:fortu=0to3:print"plr."tu+1"-"sc(tu),:next:poke198,0
3045 print""spc(7)"press any key to cont."
3050 geta$:ifa$=""then3050
3060 t=0:goto35
3066 rem *********************
3070 forx=0to255:in(x,y)=0:next:return