home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / commodore-users-of-norman / CUON_06_(08-1984).d64 / submarine.p (.txt) < prev    next >
Commodore BASIC  |  2019-04-13  |  6KB  |  203 lines

  1. 1 PRINT"[147]"
  2. 6 POKE59467,16:POKE59466,15:POKE59464,0
  3. 10 GOSUB20000:GOTO1000
  4. 100 PRINT""SPC(8)":D.CHARGES:";:IFBA=0THENPRINT"  ":GOTO110
  5. 105 FORA=1TOBA:PRINT""A"[157]";:NEXT:PRINT"[146]        "
  6. 110 PRINT"SCORE:"SC"[157] ":RETURN
  7. 120 PRINTH$SPC(DP)S$:RETURN
  8. 140 POKEFNA(0),39:RETURN
  9. 150 IFDP+X+5>39THENX=X-1:FL=-FL:RETURN
  10. 155 IFDP+X-5<2THENX=X+1:FL=-FL:RETURN
  11. 160 RETURN
  12. 165 FORS=1TO20:NEXTS:RETURN
  13. 170 POKEFNA(0),32:RETURN
  14. 300 POKEE,0:POKEE,28
  15. 305 PRINTH$""SPC(SP)")(":IFBF=0THEN330
  16. 310 GOSUB160:PRINTH$""SPC(SP-1)"[205] [165][206]":GOSUB160
  17. 311 POKE59467,16:POKE59466,15
  18. 312 FORQ=1TO2
  19. 313 FORD=180TO250STEP5:POKE59464,D:NEXTD
  20. 314 POKE59467,16:POKE59466,15:POKE59464,0
  21. 315 NEXTQ:GOSUB160
  22. 320 PRINTH$""SPC(SP-1)"    "
  23. 330 GOSUB160:PRINTH$""SPC(SP)"  "
  24. 340 POKEE,0:RETURN
  25. 500 RETURN
  26. 510 FORL2=0TO9:NEXT:RETURN
  27. 1000 PRINT"[147]":POKE59459,255:A$=" [170][157][157][157][157] % ":B$="0[146]D"
  28. 1020 S1$=A$+"1"+B$:S3$=A$+"3"+B$:S5$=A$+"5"+B$:S7$=A$+"7"+B$:S9$=A$+"9"+B$
  29. 1030 A$="[180] [157][157][157][157]C":B$="0 [146]% ":S2$=A$+"2"+B$:S4$=A$+"4"+B$:S6$=A$+"6"+B$
  30. 1040 S8$=A$+"8"+B$:SE$=" [157][157][157]     "
  31. 1060 S$=" [162] [157][157][157][157][157][157][157] [192][168] [215][215][215][146] [168][192] [157][157][157][157][157][157][157][157][157][157][157][157] [223]COMMODORE[146][169] ":H$=""
  32. 1065 SN$="[157][157][157][157]     [162]     [157][157][157][157][157][157][157][157][157][157][157] [192][168] [215][215][215][146] [168][192] "
  33. 1067 SM$="[157][157][157][157]     [162]     "
  34. 1070 DIMV$(9):V$(1)="":FORL=2TO9:V$(L)=V$(L-1)+"":NEXT
  35. 1100 DIMA(9),P(9),M(2):SS$="[185][185][190][146][185][185]   ":ST$="        ":FO$="4":FI$="5":SI$="6"
  36. 1120 SC=0:BA=6:DP=20:F1=.03:F2=.1:FL=1
  37. 1130 FORL=2TO8STEP2:P(L)=36:NEXT
  38. 1150 TF=7200:DS=0:E=59471:BL=33727:SN=32768:SA=33007:SZ=80:TG=91
  39. 1160 DEFFNA(P)=PO+Y+X
  40. 2000 TI$="000000":POKE59468,12
  41. 2010 SU$="[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":PRINTSU$;
  42. 2015 FORL=33728TO33767:POKEL,104:NEXT
  43. 2020 GOSUB100:GOSUB120
  44. 3000 F=F+1:IFF>9THENF=1
  45. 3210 ONFGOTO4100,4000,3900,3800,3700,3600,3500,3400,3300
  46. 3300 IFRND(9)>F1ANDP(9)=0THEN3400
  47. 3320 P(9)=P(9)+1:IFP(9)=36THENPRINTV$(9)SPC(35)SE$;:P(9)=0:GOTO3400
  48. 3330 PRINTV$(9)SPC(P(9))S9$;
  49. 3340 IFRND(TI)<F2THENMI=9:GOSUB8000
  50. 3400 IFRND(8)>F1ANDP(8)=36THEN3500
  51. 3420 P(8)=P(8)-1:IFP(8)=0THENPRINTV$(8)" "SE$:P(8)=36:GOTO3500
  52. 3430 PRINTV$(8)SPC(P(8))S8$;
  53. 3440 IFRND(TI)<F2THENMI=8:GOSUB8000
  54. 3500 IFRND(7)>F1ANDP(7)=0THEN3600
  55. 3520 P(7)=P(7)+1:IFP(7)=36THENPRINTV$(7)SPC(35)SE$;:P(7)=0:GOTO3600
  56. 3530 PRINTV$(7)SPC(P(7))S7$;
  57. 3540 IFRND(TI)<F2THENMI=7:GOSUB8000
  58. 3600 IFRND(6)>F1ANDP(6)=36THEN3700
  59. 3620 P(6)=P(6)-1:IFP(6)=0THENPRINTV$(6)" "SE$;:P(6)=36:GOTO3700
  60. 3630 PRINTV$(6)SPC(P(6))S6$;
  61. 3640 IFRND(TI)<F2THENMI=6:GOSUB8000
  62. 3700 IFRND(5)>F1ANDP(5)=0THEN3800
  63. 3720 P(5)=P(5)+1:IFP(5)=36THENPRINTV$(5)SPC(35)SE$;:P(5)=0:GOTO3800
  64. 3730 PRINTV$(5)SPC(P(5))S5$;
  65. 3740 IFRND(TI)<F2THENMI=5:GOSUB8000
  66. 3800 IFRND(4)>F1ANDP(4)=36THEN3900
  67. 3820 P(4)=P(4)-1:IFP(4)=0THENPRINTV$(4)" "SE$;:P(4)=36:GOTO3900
  68. 3830 PRINTV$(4)SPC(P(4))S4$;
  69. 3840 IFRND(TI)<F2THENMI=4:GOSUB8000
  70. 3900 IFRND(3)>F1ANDP(3)=0THEN4000
  71. 3920 P(3)=P(3)+1:IFP(3)=36THENPRINTV$(3)SPC(35)SE$;:P(3)=0:GOTO4000
  72. 3930 PRINTV$(3)SPC(P(3))S3$;
  73. 3940 IFRND(TI)<F2THENMI=3:GOSUB8000
  74. 4000 IFRND(2)>F1ANDP(2)=36THEN4100
  75. 4020 P(2)=P(2)-1:IFP(2)=0THENPRINTV$(2)" "SE$;:P(2)=36:GOTO4100
  76. 4030 PRINTV$(2)SPC(P(2))S2$;
  77. 4100 IFRND(1)>F1ANDP(1)=0THEN4200
  78. 4120 P(1)=P(1)+1:IFP(1)=36THENPRINTV$(1)SPC(35)SE$;:P(1)=0:GOTO4200
  79. 4130 PRINTV$(1)SPC(P(1))S1$;
  80. 4200 IFTI>TFTHEN10000
  81. 4203 TH=INT((TF-TI)/SZ)+1:IFTG>THTHENPRINT"TIME"TH"[157] ":TG=TH
  82. 4205 GETC$:IFC$<FO$ORC$>SI$THEN6000
  83. 4210 FORL=0TO5:GETCE$:NEXT:IFC$=FI$THEN8300
  84. 4230 IFC$=FO$THENDP=DP-1:FL=-1:IFDP<5THENDP=5:GOTO4300
  85. 4240 IFC$=SI$THENDP=DP+1:FL=1:IFDP>32THENDP=32
  86. 4300 GOSUB120
  87. 6000 FORL=0TO5:IFA(L)=0THEN6499
  88. 6020 A(L)=A(L)+40
  89. 6030 POKEA(L)+40*(A(L)>SA),32
  90. 6040 PO=A(L):A=PEEK(PO):IF(A=32ANDRND(1)>F1)ORA=39THEN6300
  91. 6050 A(L)=0:POKEE,0:POKEE,18:POKEPO,42:GOSUB160:POKEPO,32:POKEE,0
  92. 6070 IFA=46THEN8200
  93. 6080 IFA=32ORA=104THENPOKEPO,A:GOTO6499
  94. 6100 GOSUB6110:GOTO6499
  95. 6110 Y=INT((INT((PO-SN)/40)-4)/2):X=P(Y):POKEE,0:POKEE,18
  96. 6120 POKE59467,16:POKE59466,15
  97. 6121 FORI=1TO7:POKE59467,16:POKE59466,7:POKE59464,115-.3*I
  98. 6123 POKE59466,128:NEXTI:POKE59467,0
  99. 6125 POKE59467,16:POKE59466,15:POKE59464,0
  100. 6130 PRINTV$(Y)SPC(X+1)"###"
  101. 6140 PRINTV$(Y)SPC(X)"[166][164][166][166]$"
  102. 6200 SC=SC+Y*10:DS=DS+1:GOSUB110
  103. 6210 P(Y)=0:IFY-INT(Y/2)*2=0THENP(Y)=36
  104. 6220 PRINTV$(Y)SPC(X)SE$:GOSUB160:RETURN
  105. 6300 POKEPO,39
  106. 6499 NEXT
  107. 6500 FORL=0TO2:IFM(L)=0THEN6999
  108. 6520 POKEM(L),32:M(L)=M(L)-40:PO=M(L)
  109. 6530 A=PEEK(PO):IFA=32THENPOKEPO,46:GOTO6800
  110. 6540 IFA<>39THEN6600
  111. 6550 POKEPO,42:POKEE,0:POKEE,18:GOSUB160:POKEE,0:POKEPO,32:M(L)=0:L=0
  112. 6560 IFA(L)=POTHENA(L)=0:GOTO6999
  113. 6570 L=L+1:GOTO6560
  114. 6600 IFA<>99THEN6900
  115. 6610 BF=1:PO=PO-40:B=PEEK(PO)
  116. 6620 SP=PO-INT(PO/40)*40-8:IFSP<1THENSP=SP+40
  117. 6625 IFSP<2THENSP=2
  118. 6630 GOSUB300:M(L)=0:IFB=32THEN6999
  119. 6700 GOTO8600
  120. 6800 IFRND(1)>F2THEN6999
  121. 6820 POKEE,0:POKEE,18:POKEPO,42:GOSUB160:POKEPO,32:POKEE,0:M(L)=0:GOTO6999
  122. 6900 M(L)=0:POKEE,0:POKEE,18:POKEPO,42:GOSUB160:POKEPO,32:POKEE,0:GOSUB6110
  123. 6999 NEXT
  124. 7000 IFTI<TTHEN3000
  125. 7110 T=TI+600:BA=BA+1:IFBA>6THENBA=6
  126. 7120 GOSUB100
  127. 7999 GOTO3000
  128. 8000 L=0
  129. 8010 IFM(L)=0THEN8100
  130. 8020 L=L+1:IFL<3THEN8010
  131. 8040 RETURN
  132. 8100 M(L)=32928+MI*80+P(MI)-5*(MI-INT(MI/2)*2=1):RETURN
  133. 8200 L1=0
  134. 8210 IFM(L1)=POTHENM(L1)=0:GOTO6499
  135. 8220 L1=L1+1:GOTO8210
  136. 8300 BA=BA-1:IFBA<0THENBA=0:GOTO6000
  137. 8310 POKEE,0:POKEE,25:BF=1:GOSUB100:SP=DP:GOSUB120
  138. 8330 L1=0
  139. 8340 IFA(L1)=0THEN8400
  140. 8350 L1=L1+1:GOTO8340
  141. 8400 PO=32928+DP+FL*5:X=0:Y=0
  142. 8420 X=X+FL:Y=Y-40:POKEE,0:GOSUB150
  143. 8440 GOSUB140:GOSUB170:X=X+FL:Y=Y-40:GOSUB150
  144. 8460 GOSUB140:GOSUB170:X=X+FL:GOSUB150
  145. 8480 GOSUB140:GOSUB170:X=X+FL:Y=Y+40:GOSUB150
  146. 8490 IFPEEK(FNA(0))<>32THEN8600
  147. 8500 GOSUB140:GOSUB170:X=X+FL:Y=Y+40:GOSUB150
  148. 8510 IFPEEK(FNA(0))<>32THEN8600
  149. 8520 GOSUB140:GOSUB170:SP=FNA(0)-32928:BF=0:GOSUB300
  150. 8540 A(L1)=FNA(0)+80:GOTO6000
  151. 8600 GOSUB300:POKEE,0:POKEE,18:
  152. 8604 POKE59467,16:POKE59466,15
  153. 8605 FORI=1TO20:POKE59464,100:POKE59464,50:POKE59464,200:POKE59464,0:NEXTI
  154. 8610 PRINT""SPC(DP)"  "SPC(DP)SN$:FORL1=0TO200:NEXT
  155. 8615 PRINT""SPC(DP)"  "SPC(DP)SM$:FORL1=0TO200:NEXT
  156. 8620 PRINT""SPC(DP)"  ":FORL1=0TO200:NEXT
  157. 8690 SP=DP:GOSUB300:POKEE,18
  158. 8692 PRINT"":FORL=0TO2:PRINT"                                        ";:NEXT
  159. 8693 FORL=0TO99:GETC$:NEXT
  160. 8695 DP=20:GOSUB120
  161. 8699 SC=INT(SC/2):GOSUB110:GOTO3000
  162. 10000 PRINT"TIME 0"
  163. 10010 IFSC<200ORF3=1THEN10100
  164. 10020 POKEE,0:POKEE,8:FORL=0TO7:PRINT"E X T E N D E D   P L A Y"
  165. 10030 GOSUB165:PRINTSU$:GOSUB510:NEXT:PRINT""SPC(27)"EXTEN'D PLAY"
  166. 10080 IFSC<500THEN10099
  167. 10090 POKEE,0:TI$="000000":T=0:BA=6:F3=1:TF=3600:TG=46:GOSUB100:GOTO3000
  168. 10099 POKEE,0:TI$="000000":T=0:BA=6:F3=1:TF=2400:TG=31:GOSUB100:GOTO3000
  169. 10100 PRINTV$(3)SPC(10)"G A M E   O V E R":GOSUB500
  170. 10110 IFDS=0THEN10170
  171. 10120 PRINTV$(6):FORL=1TODS
  172. 10130 PRINTSS$;:NEXT
  173. 10135 IFDS>31THENLETDS=31
  174. 10140 FORL=0TODS*8-8STEP8:POKEE,0:POKEE,31:PRINTV$(6):IFL<>0THENPRINTSPC(L)
  175. 10145 POKE59467,16:POKE59466,15
  176. 10146 FORD=175TO180STEP1:POKE59464,D:NEXTD
  177. 10149 POKE59467,16:POKE59466,15:POKE59464,0
  178. 10150 FORL1=0TO2:PRINTSS$"[157][157][157][157][157][157][157][157]";:GOSUB510:PRINTST$"[157][157][157][157][157][157][157][157]";
  179. 10160 GOSUB510:NEXT:POKEE,0:SC=SC+30:GOSUB110:NEXT
  180. 10170 PRINTV$(4)SPC(7)" YOUR SCORE: [157]"SC
  181. 10200 FORL=0TO99:GETC$:NEXT
  182. 10210 PRINTSPC(5)"PRESS ANY KEY TO PLAY AGAIN."
  183. 10215 POKE59467,16:POKE59466,15:FORS=1TO15
  184. 10216 FORD=180TO250STEP5:POKE59464,D:NEXTD:NEXTS:POKE59467,0
  185. 10217 POKE59467,16:POKE59466,15:POKE59464,0
  186. 10220 GETC$:IFC$=""THEN10220
  187. 10999 CLR:PRINT"[147]":GOTO1000
  188. 20000 POKE59468,13:PRINT"[147]"
  189. 20010 PRINT"[169]  [223][146]  [146]   [146]   [223][146] [223][146]  [169][146]  [169][223][146]    [223][146]    [146] [223][146]   [146]   "
  190. 20020 PRINT" [146]     [146]   [146]  [146] [169]  [223][169] [146] [169]  [223][146]  [146]  [146]   [146]   [223][146]  [146]  "
  191. 20030 PRINT"[223]  [223][146]  [146]   [146]   [223][146]  [146][223][169] [146]  [146][161][161] [146]   [146][169]   [146]   [146][223][223] [146]   "
  192. 20040 PRINT"    [146]  [146]   [146]  [146]  [146]  [146]   [146]     [146]  [146][223][223][146]   [146]   [146] [146][223] [146]  "
  193. 20050 PRINT"[223]  [146][169] [223]  [146][169]   [146][169]  [146]   [146]  [146]   [146]  [146] [223][223][146]   [146]  [146]   [146]   "
  194. 20100 P2=33600:FORP1=33700TO32768STEP-40:P3=PEEK(P1):P4=PEEK(P2)
  195. 20110 POKEP1,87:POKEP2,87:FORL=0TO99:NEXT
  196. 20120 POKEP1,P3:POKEP2,P4:P2=P2-40:NEXT
  197. 20230 POKE59468,12:PRINT"[147]INSTRUCTIONS"
  198. 20340 PRINT"45 SECONDS[160]EXTENDED PLAY.(NOT INCLUDING":PRINT"BONUS.)"
  199. 20350 PRINT"THERE WILL BE 30 POINT BONUSES PER EACH":PRINT"SHIP DESTROYED!"
  200. 20900 PRINTSPC(7)"PRESS 'RETURN[146]' TO BEGIN"
  201. 20910 GETC$:IFC$=""THEN20910
  202. 29999 RETURN
  203.