home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1988 October / 1988-10.d64 / computag (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  6KB  |  159 lines

  1. 10 rem copyright 1988 compute! publications, inc. - all rights reserved
  2. 20 poke53280,6:poke53281,6:print"[147][159]  copyright 1988 compute! pub., inc."
  3. 30 printtab(11)"all rights reserved"
  4. 40 fori=1to345:reada:x=x+a:next:ifx<>34871thenprint"data statement error":stop
  5. 50 restore
  6. 60 onlo+1goto320,630
  7. 70 ifsx(1)=sx(2)andsy(1)=sy(2)then1010
  8. 80 ifk$<>""andpl=2thenpl=1:goto150
  9. 90 iflm<maandma<97thenpokeka(int(ma)),160:lm=lm+1:poke254,0:poke255,3:goto90
  10. 100 ma=ma+.04:ifma>97thenpoke173,0:pokeka(97),160:goto1310
  11. 110 x=peek(653):getk$:if(asc(k$+chr$(0))and127)<>a1andx=0then90
  12. 120 pl=1:ma=ma+.25:ifx>0thenpl=2
  13. 130 e(1)=peek((40*dn(1)+1024+ac(1))):e(2)=peek((40*dn(2)+1024+ac(2))):goto150
  14. 140 goto1010
  15. 150 pi=(e(pl)-128)/4+1
  16. 160 poke254,pl*16:poke255,15:onpigoto180,210,250,280
  17. 170 rem ** up **
  18. 180 ifsy(pl)-16<69then70
  19. 190 dn(pl)=dn(pl)-2:sy(pl)=sy(pl)-16:gosub1110:gosub300:goto70
  20. 200 rem ** left **
  21. 210 ifa(pl)=1thensx(pl)=sx(pl)+255
  22. 220 ifsx(pl)-16<57then70
  23. 230 ac(pl)=ac(pl)-2:sx(pl)=sx(pl)-16:gosub1110:gosub300:goto70
  24. 240 rem ** down **
  25. 250 ifsy(pl)+16>213then70
  26. 260 dn(pl)=dn(pl)+2:sy(pl)=sy(pl)+16:gosub1110:gosub300:goto70
  27. 270 rem ** right **
  28. 280 ifsx(pl)+16>249then70
  29. 290 ac(pl)=ac(pl)+2:sx(pl)=sx(pl)+16:gosub1110:gosub300:goto70
  30. 300 ifpl=chthensc(pl)=sc(pl)+1
  31. 310 print""spc(32)sc(1)" ":print""spc(32)sc(2)" ":return
  32. 320 pa$="player":poke53269,0:print"":gosub1450
  33. 330 print"[159]   player 1's key  "+chr$(142)+chr$(8);:gosub1430:p1$=p$:printp$
  34. 340 print"[159]   player 2 uses [159]shift"
  35. 350 print"[159]   arrow speed (1-5)  ";
  36. 360 gosub1430:ifp$<"1"orp$>"5"orp$=""then360
  37. 370 as=val(p$)*50:printp$:print:printspc(14)"[159]please wait"
  38. 380 a1=asc(p1$)and127:gosub1260
  39. 390 a$(1)="@a[157][157]bc[146][145]":a$(2)="de[157][157]fg[146][145]":a$(3)="hi[157][157]jk[146][145]":a$(4)="lm[157][157]no[146][145]"
  40. 400 a$(5)="[151]  [157][157]  [146][145]"
  41. 410 ch=1
  42. 420 cl(1)=3:cl(2)=7:fori=54272to54296:pokei,0:next:poke54278,192:poke54276,32
  43. 430 poke54276,33:poke54296,15:gosub460:ifagthen600
  44. 440 goto570
  45. 450 rem ** choose random position **
  46. 460 ifrnthen480
  47. 470 po(1)=1:po(2)=130:rn=1:goto500
  48. 480 po(1)=int(130*rnd(0))+1
  49. 490 po(2)=int(130*rnd(1))+1:ifpo(1)=po(2)then490
  50. 500 formt=1to2
  51. 510 sy(mt)=69:sx(mt)=57
  52. 520 dn=13:fori=1to9:ifpo(mt)>dnthensy(mt)=sy(mt)+16:dn=dn+13
  53. 530 next
  54. 540 ab=dn-po(mt):ac=12-ab:aa=16*ac+sx(mt)
  55. 550 sx(mt)=aa
  56. 560 ac(mt)=5+(2*ac):dn(mt)=1+(2*(dn/13)):nextmt:return
  57. 570 ml$="[162]"+chr$(8)+"[189]<"+chr$(3)+"[149]x[202]"+chr$(16)+chr$(248)+"l[191][163]":poke835,0
  58. 580 poke836,208:poke830,0:poke831,216:poke828,0:poke829,56:poke56334,0
  59. 590 poke1,51:ml$=ml$:sys(peek(51)+256*peek(52)):poke1,55:poke56334,1
  60. 600 fori=13312to13312+128:readj:pokei,j:next
  61. 610 gosub1070
  62. 620 fori=0to152:readj:poke49152+i,j:next
  63. 630 ifpeek(789)=0then650
  64. 640 poke53265,27:poke56333,127:poke788,0:poke789,192:poke53274,129
  65. 650 poke53272,28:poke53280,11:poke53281,11
  66. 660 rem ** ^ **
  67. 670 data 255,128,128,128,128,129,131,135
  68. 680 data 255,1,1,1,1,129,193,225
  69. 690 data 129,129,129,129,128,128,128,255
  70. 700 data 129,129,129,129,1,1,1,255
  71. 710 rem ** _ **
  72. 720 data 255,128,128,128,128,130,134,143
  73. 730 data 255,1,1,1,1,1,1,241
  74. 740 data 143,134,130,128,128,128,128,255
  75. 750 data 241,1,1,1,1,1,1,255
  76. 760 data 255,128,128,128,129,129,129,129
  77. 770 data 255,1,1,1,129,129,129,129
  78. 780 data 135,131,129,128,128,128,128,255
  79. 790 data 225,193,129,1,1,1,1,255
  80. 800 rem ** /////// **
  81. 810 data 255,128,128,128,128,128,128,143
  82. 820 data 255,1,1,1,1,65,97,241
  83. 830 data 143,128,128,128,128,128,128,255
  84. 840 data 241,97,65,1,1,1,1,255
  85. 850 poke173,0
  86. 860 print"[147]":gosub870:goto920
  87. 870 print"[151]";:fori=1to2:print"                                        ";
  88. 880 next:print"    [207][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][208]       "
  89. 890 fori=1to20:print"    [180][170]       ":next
  90. 900 print"    [204][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][186]       "
  91. 910 print"                                       ":return
  92. 920 forz=1to10:print"";:fori=1to13:x=int(4*rnd(1))+1
  93. 930 printa$(x);:next:print""
  94. 940 next
  95. 950 fori=1063to2023step40:pokei,160:pokei+54272,11:next
  96. 960 poke53281,12
  97. 970 gosub310:pokev+21,255
  98. 980 poke172,0:poke173,as:poke160,256-as
  99. 990 goto70
  100. 1000 rem ** player tagged **
  101. 1010 poke173,0:pokev+40,cl(ch):ifch=1thench=2:hc=1:goto1030
  102. 1020 ch=1:hc=2
  103. 1030 cz$=str$(hc):print""spc(12)"player "cz$" is now it":gosub1440
  104. 1040 print""spc(12)"[151]                   "
  105. 1050 fori=1to500:next:pokev+21,0:gosub460:gosub1090:goto970
  106. 1060 rem ** sprite **
  107. 1070 v=53248:poke2042,13:poke2041,13
  108. 1080 forn=0to62:readi:poke832+n,i:next
  109. 1090 pokev+40,3
  110. 1100 pokev+41,7:poke53275,7
  111. 1110 gosub1220
  112. 1120 pokev+2,sx(1):pokev+3,sy(1)
  113. 1130 pokev+4,sx(2):pokev+5,sy(2):return
  114. 1140 data0,0,0,0,0,0,0,0,0
  115. 1150 data0,0,0,0,0,0,0,0
  116. 1160 data0,0,0,0,0,0,127,248
  117. 1170 data0,127,248,0,127,248,0,127
  118. 1180 data248,0,127,248,0,127,248,0
  119. 1190 data127,248,0,127,248,0,127,248
  120. 1200 data0,127,248,0,127,248,0,127
  121. 1210 data248,0,0,0,0,0,0
  122. 1220 a(1)=0:a(2)=0
  123. 1230 ifpeek(v+16)=4orpeek(v+16)=6thena(2)=1
  124. 1240 ifpeek(v+16)=2orpeek(v+16)=6thena(1)=1
  125. 1250 return
  126. 1260 dimka(101):ka(1)=1108:fori=2to21:ka(i)=ka(1)+40*(i-1):next
  127. 1270 ka(22)=1948:fori=23to49:ka(i)=ka(22)+(i-22):next
  128. 1280 ka(50)=1974:fori=51to70:ka(i)=ka(49)-40*(i-50):next
  129. 1290 ka(71)=1135:fori=72to97:ka(i)=ka(i-1)-1:next
  130. 1300 return
  131. 1310 print"";:ifgm=1then1340
  132. 1320 gm=1:print""spc(10)"round 1 over":gosub1440:gosub470:ma=0:lm=0:gosub870
  133. 1330 gosub1120:print"            ":gosub310:goto980
  134. 1340 print"[147]"spc(12)"g a m e   o v e r":poke53280,6:poke53281,6:poke53269,0
  135. 1350 print"[159]      player one scored"sc(1)
  136. 1360 print"[158]      player two scored"sc(2)
  137. 1370 p$="1":ifsc(2)>sc(1)thenp$="2"
  138. 1380 ifsc(1)<>sc(2)thenprint"[129]player "p$" wins by"abs(sc(1)-sc(2))"points"
  139. 1390 ifsc(1)=sc(2)thenprintspc(10)"[153]it's a tie game"
  140. 1400 print"      press any key to play again"
  141. 1410 gosub1430
  142. 1420 clr:ag=-1:print"[147]":goto60
  143. 1430 poke198,0:wait198,1:getp$:return
  144. 1440 fordelay=1to4000:next:return
  145. 1450 print"  [213][195][195][201][213][195][195][201][213][201]  [213][201][213][195][195][201][213][201][213][201][213][195][195][195][195][201][213][195][195][201][213][195][195][201]"
  146. 1460 print"  [194][213][195][203][194][213][201][194][194][202][201][213][203][194][194][213][201][194][194][194][194][194][202][195][201][213][195][203][194][213][201][194][194][213][195][203]"
  147. 1470 print"  [194][194]  [194][194][194][194][194][213][201][213][201][194][194][202][203][194][194][221][221][194]  [194][194]  [194][202][203][194][194][194][213][201]"
  148. 1480 print"  [194][202][195][201][194][202][203][194][194][194][202][203][194][194][194][213][195][203][194][202][203][194]  [194][194]  [194][213][201][194][194][202][203][194]"
  149. 1490 print"  [202][195][195][203][202][195][195][203][202][203]  [202][203][202][203]  [202][195][195][203]  [202][203]  [202][203][202][203][202][195][195][203]":return
  150. 1500 data 165,173,240,60,165,162,197,172,208,54,169,4,133,175,169,0
  151. 1510 data 133,174,168,177,174,201,128,144,10,201,144,176,6,105,4,41
  152. 1520 data 143,145,174,200,192,231,208,16,165,175,201,7,144,10,165,172
  153. 1530 data 24,101,173,133,172,56,176,8,192,0,208,215,230,175,208,211
  154. 1540 data 165,255,48,14,198,255,41,15,24,101,254,170,189,105,192,141
  155. 1550 data 1,212,169,1,141,25,208,169,0,141,18,208,173,13,220,41
  156. 1560 data 1,240,3,76,49,234,76,188,254,0,128,104,88,76,68,62
  157. 1570 data 56,52,49,47,45,44,43,42,42,0,16,24,40,8,16,32
  158. 1580 data 48,24,32,48,64,4,8,16,24,0,122,0,80,0,52,0,20,0,18,0,14,0,12,0,11
  159.