home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun: Game Pak / rerun-gamepak / snakes (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  74 lines

  1. 10 poke53281,0:poke53280,0:cl(0)=3:cl(1)=13:cl(2)=4:cl(3)=7:cr(1)=81:cr(0)=87
  2. 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
  3. 30 dimin(255,3):c=54272:cr(2)=42:cr(3)=90
  4. 35 gosub2050
  5. 36 rem ***********************
  6. 40 print"[147][159]                                       "
  7. 45 forx=1to20
  8. 50 print" [146]                                      [146]"
  9. 60 next
  10. 70 print"[159]                                       "
  11. 80 rem ***********************
  12. 90 forx=0to3
  13. 100 pl(x)=1024+int(rnd(1)*20)*40+int(rnd(1)*38)
  14. 110 ifpeek(pl(x))<>32then100
  15. 120 pokepl(x),cr(x):pokepl(x)+c,cl(x)
  16. 130 next
  17. 200 rem **********************
  18. 210 fortu=0to3
  19. 220 cl=cl(tu):cr=cr(tu):pl=pl(tu):mv=0
  20. 230 gosub2000
  21. 240 ifsi=255thengosub2500::goto1000
  22. 250 ifin(si,tu)thenpl=pl+in(si,tu):pokepl,cr(tu):pokepl+c,cl:goto230
  23. 260 gosub2040:print"what direction, player"tu+1;:poke1930,cr:poke1930+c,cl
  24. 265 ifsn(tu)>2then500
  25. 266 poke198,0
  26. 270 geta$:ifa$=""then270
  27. 280 x=(a$="b")+(a$="h")*2+(a$="y")*3+(a$="u")*4+(a$="i")*5+(a$="j")*6+(a$="m")*7
  28. 285 x=abs(x)
  29. 290 ifx>0ora$="n"then305
  30. 300 goto270
  31. 305 if(siand2^x)=(2^x)then270
  32. 310 in(si,tu)=dr(x):pl=pl+dr(x)
  33. 320 pokepl,cr:pokepl+c,cl
  34. 330 goto1000
  35. 500 x=int(rnd(1)*8)
  36. 510 if(siand2^x)=(2^x)then500
  37. 520 goto310
  38. 1000 pl(tu)=pl:next
  39. 1010 ift=4thengoto3000
  40. 1020 t=0:goto200
  41. 2000 rem *********************
  42. 2010 si=0:forx=0to7:i=peek(pl+dr(x)):ifi=32thennext:return
  43. 2020 si=si+2^x:next:return
  44. 2030 rem *********************
  45. 2040 print"":forx=1to21:print:next:return
  46. 2050 rem *********************
  47. 2060 print"[147]":forx=1to8:print:next
  48. 2070 printspc(16)"snakes"
  49. 2080 printspc(16)"[163][163][163][163][163][163]"
  50. 2100 print"":forx=1to15:print:next:print"1. player controlled-new"
  51. 2110 print"2. player controlled-old"
  52. 2120 print"3. computer controlled-new"
  53. 2130 print"4. computer controlled-old"
  54. 2140 fory=0to3:print"":forx=1to12:print:next:print"snake"y+1"type : [157]";:poke204,0
  55. 2150 geta$:ifval(a$)=0orval(a$)>4then2150
  56. 2160 sn(y)=val(a$):printa$:poke204,1
  57. 2165 ifsn(y)=1orsn(y)=3thengosub3070
  58. 2170 next:return
  59. 2500 gosub2040:print"                              "
  60. 2510 gosub2040:print"player"tu+1"is trapped"
  61. 2520 t=t+1:return
  62. 3000 rem *********************
  63. 3003 gosub2040:print"                              ":forx=0to4:sc(x)=0:next
  64. 3005 forx=1024to1924
  65. 3010 i=peek(x)
  66. 3020 fory=0to3:ifi=cr(y)thensc(y)=sc(y)+1
  67. 3030 next:next
  68. 3040 gosub2040:fortu=0to3:print"plr."tu+1"-"sc(tu),:next:poke198,0
  69. 3045 print""spc(7)"press any key to cont."
  70. 3050 geta$:ifa$=""then3050
  71. 3060 t=0:goto35
  72. 3066 rem *********************
  73. 3070 forx=0to255:in(x,y)=0:next:return
  74.