home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 186 / 186.d81 / harbour (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1999-01-01  |  14.3 KB  |  410 lines

  1. 1 rem    ***** harbour *****
  2. 5 dv=peek(186):ifdv<8thendv=8
  3. 40 sys57812"f.harbour",dv,0:poke780,0:poke781,0:poke782,8:sys65493
  4. 45 sys57812"toolbox117 c000",dv,0:poke780,0:poke781,0:poke782,192:sys65493
  5. 50 sys57812"getword 1000",dv,0:poke780,0:poke781,0:poke782,16:sys65493
  6. 60 clr:dv=peek(186):ifdv<8thendv=8
  7. 100 rem    **** set variables *****
  8. 105 ad=49152:ag=4096:s=54272:poke53272,19:printchr$(14):printchr$(8)
  9. 110 a$="":at=0:b$="":bh$="":bd=0:bk=0:bl=0:c$="":cd%=0
  10. 115 ch=0:cs=0:ct=0:d=0:df$="":dl$="":dr=0:ds=0:el%=0:ev%=0
  11. 120 f%=0:fl%=250:fu%=0:ft%=250:gl%=0:gt=0:gw=1:hf=0:k=0
  12. 130 ms$="":nm$="":pc%=0
  13. 135 q=0:q$=chr$(34):qf=0:rn%=0:se%=0:ra%=0
  14. 140 sd%=0:sn%=0:p%=0:sz=0:ts%=0:tv%=0:us%=0:vt=250:vt%=0
  15. 145 v=0:w$="":x=0:y=0:z=0:zs=0:x$=""
  16. 150 dima$(24),gl$(99),l1%(48),l2%(48),md$(2,20),sd$(5),sp$(5),zl(5)
  17. 155 dimst%(48),ub%(48),el$(11),hl$(5),fl$(5)
  18. 160 fl$(1)=".ex":fl$(2)=".fc":fl$(3)=".ag":hl$(1)="[197]xpert":hl$(2)="[211]enior"
  19. 165 hl$(3)="[202]unior":hl$(4)="[203][195][194]":hl$(5)="[214][195]":fl$(4)=".kcb":fl$(5)=".vc"
  20. 170 sh$(1)="[217]our have been rewarded as a [203][195][194]."
  21. 175 sh$(2)="[217]ou have been awarded a [214][195]."
  22. 800 rem    ***** startup *****
  23. 805 df$="ac.game":dr=dv:gosub5115:ifpr<>3then1005
  24. 810 open3,dv,3,"l:"+df$:input#3,nm$,x$,a$:ra%=val(a$):close3:gosub5740
  25. 815 print"":gosub7705:ifqf<>1thenx$="1"
  26. 820 ifx$="2"thenls%=ra%:gf=1:goto8505
  27. 1000 rem    ***** administration *****
  28. 1005 print"[147]":bd=1:bk=1:ch=0:gosub5005:gf=0
  29. 1010 ms$="[156]*** [200][197][193][196][209][213][193][210][212][197][210][211] [207][208][212][201][207][206][211] ***[144]":v=2:gosub5210
  30. 1015 a$(4)="[193]. [210]egistration.":a$(9)="[198]. [210]eview [194]ridge [208]lot."
  31. 1020 a$(5)="[194]. [211]tart [206]ew [195]onvoy.":a$(6)="[195]. [195]ontinue [195]onvoy."
  32. 1025 a$(7)="[196]. [210]eview [200]all [207]f [198]ame.":a$(12)="[216]. [197]xit ([204]oadstar/[194][193][211][201][195])"
  33. 1030 a$(8)="[197]. [210]eview [200][207][212] [203]eys.":a$(10)="[199]. [210]eview [211]ailing [201]nstructions."
  34. 1035 a$(11)="[200]. [210]eview [193]ttack [201]nstructions."
  35. 1040 h=2:tl=4:bl=12:gosub5065:gosub5085:sysad+54,0,39,1,13,8
  36. 1045 ifnm$<>""thena=2:goto1555
  37. 1050 gosub5034:ms$="[211]elect [193] to [200], [216], or ^.":gosub5205:gosub6165
  38. 1055 zs=1:ch$="abcdghe^xf":sysad+48,ch$
  39. 1060 gosub5034:iff%=10thengosub1205:goto1050
  40. 1062 iff%=9thengosub5220:onqfgoto1050,5505
  41. 1065 iff%=8thengosub6105:goto1050
  42. 1070 iff%=7thenzs=2:gosub6105:zs=1:goto1050
  43. 1072 iff%=5orf%=6thena=f%-4:gosub6905:goto1050
  44. 1075 iff%>1andnm$=""thengosub5240:goto1050
  45. 1080 r=0:onf%goto1505,1085,1090,1095
  46. 1085 gosub5485:gosub1155:gosub7805:onqfgoto5515,1050
  47. 1090 gosub1155:gosub7705:onqfgoto5515,1050
  48. 1095 gosub1155:ms$="[204]oad [199][193][205][197] file? (y/n)":cs=2:q=0:gosub5300:ifqf=2then1115
  49. 1100 gosub7705:ifqf<>2andts%<>0then1115
  50. 1105 ifqf=2then1050
  51. 1110 ms$="[199]ame [201]ncomplete. [193]ny key.":cs=4:q=0:gosub5300:goto1050
  52. 1115 goto8505
  53. 1150 rem    ***** select rating *****
  54. 1155 gosub5034:a$(16)="[215]hat is your rating:-"
  55. 1160 a$(17)="[193]. [197]xperienced [195]onvoy commander."
  56. 1165 a$(18)="[194]. [197]xperienced [195]apt. [198]irst [195]onvoy."
  57. 1170 a$(19)="[195]. [202]ust out of [206]aval [193]cademy."
  58. 1175 h=1:tl=16:bl=19:gosub5065:gosub5085:sysad+48,"abc"
  59. 1180 ra%=f%:tl=15:gosub5035:return
  60. 1200 rem    ***** bridge screen *****
  61. 1205 ss=6:ss$="s":gosub5405:print"[147]":poke53280,0
  62. 1210 sysad+3,0,39,1,1,160,0
  63. 1215 sysad+3,0,39,20,20,160,0
  64. 1220 a$(2)=".   [199][210][201][196] [205][193][208]   [211][212][193][212][213][211]"
  65. 1225 a$(3)=".   ========   ======"
  66. 1230 a$(4)=".  [193][194][195][196][197][198][199][200][201][202]"
  67. 1235 a$(5)=". 1\\\\\\\\\\"
  68. 1240 a$(6)=". 2\\\\\\\\\\  [212]ransports  ="
  69. 1245 a$(7)=". 3\\\\\\\\\\  [197]scorts     ="
  70. 1250 a$(8)=". 4\\\\\\\\\\  [195]ourse      ="
  71. 1255 a$(9)=". 5\\\\\\\\\\  [211]peed       ="
  72. 1260 a$(10)=". 6\\\\\\\\\\  [211]low ships  ="
  73. 1265 a$(11)=". 7\\\\\\\\\\  [213]boat kills ="
  74. 1270 a$(12)=". 8\\\\\\\\\\"
  75. 1275 a$(13)=". 9\\\\\\\\\\"
  76. 1280 a$(14)=".10\\\\\\\\\\"
  77. 1285 ms$="[204]ocation ([211]ector,[199]rid) and [198]uel data.":gosub5208
  78. 1290 h=1:forv=2to14:ms$=a$(v):gosub5070:next
  79. 1295 v=18:ms$="[198]8 = [200][209] problem report.":gosub5210
  80. 1300 v=21:ms$="[212]his area is command and info area.":gosub5210
  81. 1305 v=22:ms$="[201]nfo = storms, uboats, sinkings, etc.":gosub5210
  82. 1310 v=23:ms$="[193]ny key returns to menu":cs=4:gosub5300
  83. 1315 print"[147]":ss=6:ss$="r":gosub5405:return
  84. 1500 rem    ***** registration *****
  85. 1505 gosub5610:a=1:gosub5031:ms$="[200]ave we met before?(y/n)":cs=1:v=15
  86. 1510 gosub5305:ifqf=2thena=2:goto1530
  87. 1515 ms$="[200]ello, and welcome to convoy [200].[209].":v=15:gosub5210
  88. 1520 ms$="[208]lease register for duty.":v=16:gosub5210
  89. 1530 ms$="([204]imit = 10 characters)":v=19:gosub5210
  90. 1535 v=18:gosub5045:ms$="[217]our name please:":h=1:gosub5070:gosub5610
  91. 1540 h=20:gosub5015:ll=10:gosub5705:tl=15:bl=16:gosub5035
  92. 1545 nm$=w$:ifnm$=""thengosub6985:goto1535
  93. 1550 a$(1)="[193] pleasure to meet you "+nm$+"."
  94. 1555 a$(2)="[215]elcome back "+nm$+"."
  95. 1560 tl=18:bl=19:gosub5035:ms$=a$(a):v=15:gosub5210
  96. 1565 goto1050
  97. 5000 rem    ***** colour setup *****
  98. 5005 poke53280,bd:poke53281,bk:poke646,ch:return
  99. 5010 rem    ***** cursor locate *****
  100. 5015 poke211,h:poke214,v:sys58732
  101. 5020 return
  102. 5025 rem    ***** delete line(s) *****
  103. 5030 tl=13:bl=19:goto5035 :rem * hi score
  104. 5031 tl=14:bl=24:goto5035 :rem * administration
  105. 5034 tl=21:bl=24:goto5035 :rem * window4
  106. 5035 forv=tltobl:gosub5045:next:return
  107. 5040 v=0:goto5045         :rem * line0
  108. 5042 v=22:goto5045        :rem * line22
  109. 5043 v=23:goto5045        :rem * line23
  110. 5044 v=24:goto5045        :rem * line24
  111. 5045 poke781,v:sys59903
  112. 5046 return
  113. 5060 rem    ***** print data/at *****
  114. 5065 forv=tltobl:ms$=a$(v):gosub5070:next:return
  115. 5070 sysad+15,h,v,ms$
  116. 5075 return
  117. 5080 rem    ***** delete data *****
  118. 5085 forx=tltobl:a$(x)="":next:return
  119. 5100 rem    ***** check disk *****
  120. 5105 d=1:goto5120       :rem - load
  121. 5110 d=2:goto5120       :rem - save
  122. 5115 d=3                :rem - check
  123. 5120 gosub5258:open15,dr,15,"r:"+df$+"="+df$:input#15,er,a$,a,a:close15
  124. 5130 gosub5043:ifer=62thenondgoto5145,5145,5170
  125. 5135 ifer=63thenondgoto5175,5150,5175
  126. 5140 ifd=3then5180
  127. 5145 ms$="":gosub5300:onqfgoto5120,5180,5180
  128. 5150 ms$="":gosub5300:onqfgoto5160,5180,5180
  129. 5160 gosub5735:onqfgoto5135,5180
  130. 5165 pr=1:return
  131. 5170 pr=2:return
  132. 5175 pr=3:return
  133. 5180 pr=4:return
  134. 5200 rem    ***** centre print *****
  135. 5205 v=23:goto5210
  136. 5206 v=22:goto5210
  137. 5207 v=24:goto5210
  138. 5208 v=0
  139. 5210 gosub5045
  140. 5211 gosub5370:return
  141. 5215 ms$="[205]enu? (y/n)":cs=1:q=0:goto5300
  142. 5220 sz=zs:ms$="[193]re you sure you want to quit?(y/n)":cs=1:q=0:goto5300
  143. 5222 sz=zs:ms$="[196]ata unavailable. [193]ny key.":cs=4:q=0:goto5300
  144. 5225 sz=zs:ms$="[193]ny key when ready.":cs=4:q=0:goto5300
  145. 5230 return
  146. 5235 ms$="[195]hange disk now. [193]ny key.":cs=4:q=0:goto5300
  147. 5240 sz=zs:ms$="[198]unction/file not available. [193]ny key.":cs=4:zs=4:q=8:goto5300
  148. 5250 sz=zs:ms$="[195]ontinue?(y/n)":cs=2:q=0:goto5300
  149. 5255 sz=zs:ms$="[193]re you [210][197][193][204][204][217] sure?(y/n)":cs=2:q=0:goto5300
  150. 5258 ms$="[195][193][213][212][201][207][206] - drive activity":q=0:goto5205
  151. 5260 sz=zs:q=0:ifer=26thenms$="[215]rite protect on! [210]emoved?(y/n)":cs=2:goto5370
  152. 5280 ifer=62thenms$="[198]ile not found. [206]ew disk?(y/n)":cs=5:goto5370
  153. 5285 ifer=63thenms$="[198]ile exists. [210]eplace?(y/n)":cs=2:goto5370
  154. 5290 ifer=74thenms$="[196]rive unready. [195]orrected?(y/n)":cs=2:goto5370
  155. 5295 ms$="[205]ajor drive/disk error. [193]ny key.":cs=4:qf=3:goto5370
  156. 5300 gosub5043:zz=v:b$=ms$:goto5306
  157. 5305 zz=v:b$=ms$:gosub5045
  158. 5306 ifq=8thengosub5044:gosub6165
  159. 5307 v=zz:ms$=b$:gosub5365
  160. 5310 poke198,0:wait198,15:geta$
  161. 5315 sysad+24,a$
  162. 5320 gosub5044:ifa$="^"andq=8thengosub6105:goto5306
  163. 5321 q=0:ifa$="^"thengosub6985:goto5306
  164. 5323 zs=sz:ifcs=6anda$<>" "thengosub6985:goto5306
  165. 5325 ifcs=4orcs=6thena$="":v=zz:goto5045
  166. 5330 ifcs=3thenv=zz:goto5045
  167. 5335 qf=1:ifa$<>"y"anda$<>"n"thengosub6985:goto5306
  168. 5350 ifcs=2anda$="n"thenqf=2
  169. 5355 ifcs=1anda$="y"thenqf=2
  170. 5360 a$="":v=zz:goto5045
  171. 5365 ifms$=""then5260
  172. 5370 sysad+18,v,ms$
  173. 5375 return
  174. 5400 rem    ***** screen stash *****
  175. 5405 onssgoto5410,5415,5420,5425,5430,5435,5440
  176. 5410 sp=160:goto5450 :rem - help/harbour
  177. 5415 sp=168:goto5450 :rem - hotkeys
  178. 5420 sp=174:goto5450 :rem - help/bridge
  179. 5425 sp=16:goto5450  :rem - help load
  180. 5430 sp=208:goto5450 :rem - temp 1
  181. 5435 sp=216:goto5450 :rem - temp 2
  182. 5440 sp=224:goto5450 :rem - temp 3
  183. 5445 sp=232          :rem - temp 4
  184. 5450 m=6:ifss$="r"thenm=9
  185. 5455 sysad+m,sp
  186. 5465 return
  187. 5480 rem    ***** reset game *****
  188. 5485 ds%=0:el%=11:ev%=5:fc%=0:fu%=100:gl%=0:sd%=0:se%=100:sp%=0:tv%=50
  189. 5487 gc%=0:ts%=0:uc%=0
  190. 5490 us%=0:forx=0to48:l1%(x)=0:l2%(x)=0:st%(x)=0:ub%(x)=0:next:return
  191. 5500 rem    ***** module load *****
  192. 5503 ifdr=25thenpoke186,dv:q=64:goto5530
  193. 5505 open2,dr,2:close2:ifst<-120thendr=dr+1:goto5503
  194. 5510 qf=1:df$="hello connect":gosub5115:ifpr=3then5530
  195. 5512 dr=dr+1:goto5503
  196. 5515 x$=""
  197. 5520 qf=1:df$="bridge":dr=dv:gosub5115:ifpr<>3thenq=64:goto5505
  198. 5525 dl$=df$:goto5565
  199. 5530 print"[147]":bd=0:bk=0:ch=1:gosub5005:ifq=64then5546
  200. 5535 ms$="[197]ntering "+df$:gosub5205:poke646,0
  201. 5540 print"[144]load"q$df$q$","dv
  202. 5545 print"run":ifdf$<>"hello connect"then5548
  203. 5546 poke44,8:poke2048,0:poke53272,23:printchr$(9)
  204. 5547 ifq=64thenprint"[147]":poke646,1:new
  205. 5548 print"":poke631,13:poke632,13:poke633,13:poke198,3:end
  206. 5565 df%=1:df$="ac.game":dr=dv:gosub5115:ifpr=1orpr=4then5595
  207. 5570 ifpr=3thengosub5740:ifqf>1then5595
  208. 5575 gosub5258:open3,dv,3,"l:"+df$+",s,w":print#3,nm$:print#3,x$
  209. 5580 print#3,str$(ra%):close3:df$=dl$:gosub5043:goto5530
  210. 5595 ms$="[198]ile (ac.game)/disk problem. [193]ny.":cs=4:gosub5300:goto1050
  211. 5600 rem    ***** bload *****
  212. 5605 df$="h.convoy"+str$(zs):gw=0:goto5635
  213. 5610 ifgw=1thenreturn
  214. 5615 df$="getword 1000"
  215. 5635 gosub5258:sysad+51,df$,dv,4096
  216. 5640 ifdf$="getword 1000"thengw=1
  217. 5645 gosub5043:return
  218. 5700 rem    ***** data entry *****
  219. 5705 ch=0
  220. 5706 sysag,ch,5,ll      :rem - alpha
  221. 5710 return
  222. 5715 ch=0
  223. 5716 sysag+3,ch,7,ll    :rem - numeric
  224. 5720 return
  225. 5730 rem    ***** scratch file *****
  226. 5735 qf=1:ifq=1thenq=0:goto5740
  227. 5736 ms$="[193]re you sure you want to delete?(y/n)":cs=2:gosub5300:ifqf=2thenreturn
  228. 5740 qf=1:gosub5258:open15,dv,15,"s:"+df$:input#15,er,a$,a,a:close15:gosub5043
  229. 5745 ifer=62orer<20thenreturn
  230. 5750 qf=3:return
  231. 6000 rem    ***** timer *****
  232. 6005 x=100:goto6085
  233. 6010 x=200:goto6085
  234. 6015 x=300:goto6085
  235. 6020 x=400:goto6085
  236. 6025 x=500:goto6085
  237. 6030 x=1000:goto6085
  238. 6035 x=1500:goto6085
  239. 6040 x=2000:goto6085
  240. 6045 x=2500:goto6085
  241. 6050 x=3000:goto6085
  242. 6055 x=3500:goto6085
  243. 6060 x=4000:goto6085
  244. 6065 x=4500:goto6085
  245. 6070 x=5000:goto6085
  246. 6075 x=7500:goto6085
  247. 6080 x=10000
  248. 6085 ti$="000000"
  249. 6090 ifti<xthen6090
  250. 6095 return
  251. 6100 rem    ***** help screen s/r *****
  252. 6105 ss=7:ss$="s":gosub5405:print"[147]":bd=0:bk=1:ch=0:gosub5005
  253. 6106 ifzs>3thenz=zs-3:goto6118
  254. 6110 ifzl(zs)=1thenss=zs:ss$="r":gosub5405:goto6120
  255. 6115 gosub5605:ss=4:ss$="r":gosub5405:zl(zs)=1:ss=zs:ss$="s":gosub5405:goto6120
  256. 6118 onzgosub6130
  257. 6120 gosub5225:print"[147]":ss=7:ss$="r":gosub5405:return
  258. 6130 ms$="[198]unction cannot be used until you":v=10:gosub5210
  259. 6131 ms$="have registered    --- [207][210] ---":v=11:gosub5210
  260. 6132 ms$="file not available  --- [207][210] ---  not":v=12:gosub5210
  261. 6133 ms$="available with this option.":v=13:gosub5210:goto6120
  262. 6160 rem    ***** info line data *****
  263. 6165 ms$="^ = [200]elp.":goto5207
  264. 6170 ms$="_ = [193]bort.":goto5207
  265. 6175 ms$="_ = [193]bort. ^ = [200]elp.":goto5207
  266. 6180 ms$="[208][201][206]:[210][197][212][213][210][206] = [196]efault. (.) = [197]ntry.":goto5207
  267. 6185 ms$="[210][197][212][213][210][206] = [193]bort. [208][197][210][201][207][196] (.) = [200]elp.":goto5207
  268. 6190 ms$="30 = [193]bort. 1 = [200]elp.":v=18:goto5210
  269. 6900 rem    ***** instruction reader *****
  270. 6905 df$="t.convoy sailing":dh$="[211][193][201][204][201][206][199] [201][206][211][212][210][213][195][212][201][207][206][211]"
  271. 6906 ifa=2thendf$="t.convoy attack":dh$="[193][212][212][193][195][203] [201][206][211][212][210][213][195][212][201][207][206][211]"
  272. 6907 dr=dv:gosub5115:ifpr<>3then5240
  273. 6910 ss=5:ss$="s":gosub5405:print"[147]":bd=1:bk=1:ch=0:gosub5005:gosub6930
  274. 6915 sysad+27,df$,dv,40960,0,8,dh$
  275. 6920 forx=1to3:zl(x)=0:next:print"[147]":ss=5:ss$="r":gosub5405:return
  276. 6925 rem    ***** printer check *****
  277. 6930 qf=1:open4,4,7:close4:poke186,dv:ifst<>-128thenreturn
  278. 6935 qf=2
  279. 6940 ms$="[208]rinter [206][207][212] on. [195]orrected?(y/n)":cs=1:gosub5300:ifqf=2then6930
  280. 6945 return
  281. 6970 h=1:forv=2to14:ms$=md$(1,v-2):gosub5070:next
  282. 6980 rem    ***** rebuke *****
  283. 6985 gosub5034:ms$="[217]ou are bad "+nm$+",":v=21:gosub5210
  284. 6990 ms$="follow instructions.":v=22:gosub5210
  285. 6991 ms$="[193]ny key continues.":gosub5205
  286. 6992 a$="":geta$:ifa$=""then6992
  287. 6995 goto5034
  288. 7700 rem    ***** load game *****
  289. 7705 qf=1:df$="cg."+nm$+fl$(ra%):dr=dv:gosub5115:ifpr=2then7770
  290. 7710 ifpr<>3then7775
  291. 7715 gc%=0:gosub5258:open15,dv,15:open3,dv,3,"l:"+df$+",s,r"
  292. 7720 input#3,a$,b$,c$,d$,e$,f$,g$,h$,i$,j$,k$,l$,m$,n$:ev%=val(a$):gl%=val(b$)
  293. 7722 se%=val(c$):sd%=val(d$):sp%=val(e$):us%=val(f$):tv%=val(g$)
  294. 7725 gc%=val(h$):ds%=val(i$):fu%=val(j$):el%=val(k$):fc%=val(l$):ts%=val(m$)
  295. 7730 uc%=val(n$):forx=0to48:input#3,a$,b$,c$,d$:l1%(x)=val(a$):l2%(x)=val(b$)
  296. 7735 st%(x)=val(c$):ub%(x)=val(d$):next
  297. 7745 input#15,er,a$,a,a:close3:close15:gosub5043:ifer<20orer=63then7760
  298. 7750 ms$="[204]oad error. [210]etry?(y/n)":cs=2:q=0:gosub5300:onqfgoto7705,7775
  299. 7760 ifgc%=0thenreturn
  300. 7765 qf=2:ms$="[199]ame already credited. [193]ny key.":cs=4:q=0:goto5300
  301. 7770 qf=2:ms$="[206]o such convoy listed. [193]ny key.":cs=4:q=0:goto5300
  302. 7775 qf=2:ms$="[196]rive/[196]isk error. [193]ny key.":cs=4:q=0:goto5300
  303. 7800 rem    ***** save game *****
  304. 7805 df$="cg."+nm$+fl$(ra%):dr=dv:gosub5115:a=pr-1:onagoto7815,7870,7860
  305. 7810 gosub5735:onqfgoto7815,7865,7860
  306. 7815 qf=1:gosub5258:open15,dv,15:open3,dv,3,"l:"+df$+",s,w"
  307. 7820 print#3,str$(ev%):print#3,str$(gl%):print#3,str$(se%):print#3,str$(sd%)
  308. 7825 print#3,str$(sp%):print#3,str$(us%):print#3,str$(tv%):print#3,str$(gc%)
  309. 7830 print#3,str$(ds%):print#3,str$(fu%):print#3,str$(el%):print#3,str$(fc%)
  310. 7835 print#3,str$(ts%):print#3,str$(uc%):forx=0to48:print#3,str$(l1%(x))
  311. 7836 print#3,str$(l2%(x)):print#3,str$(st%(x)):print#3,str$(ub%(x)):next
  312. 7850 input#15,er,a$,a,a:close3:close15:gosub5043:ifer<20orer=63then7865
  313. 7855 ms$="[211]ave error. [210]etry?(y/n)":cs=2:gosub5300:onqfgoto7805,7865
  314. 7860 ms$="[196]rive error. [210]etry?(y/n)":cs=2:gosub5300:ifqf=1then7805
  315. 7865 return
  316. 7870 ifgc%=1thengosub5740:goto7815
  317. 7871 ms$="[195]onvoy already at sea. [196]elete?(y/n)":cs=2:q=0:gosub5300
  318. 7875 ifqf=1then7810
  319. 7880 return
  320. 8200 rem    ***** hi-score load *****
  321. 8205 gosub8435:ifpr<>3then8220
  322. 8210 qf=1:gosub5258:open15,dv,15:open3,dv,3,"l:"+df$+",s,r"
  323. 8215 forx=0to9:input#3,hn$(x),hq$(x):next
  324. 8216 close3:close15:goto5043
  325. 8220 ifpr=2thengosub8405:goto8255
  326. 8225 qf=2:return
  327. 8230 rem    ***** hi-score save *****
  328. 8235 gosub8435
  329. 8240 onprgoto8250,8245,8250,8270
  330. 8245 gosub8405:goto8255
  331. 8250 gosub5258:open15,dv,15,"s:"+df$:close15:gosub5043:ifqf=2then8270
  332. 8255 qf=1:gosub5258:open15,dv,15:open3,dv,3,"l:"+df$+",s,w"
  333. 8260 forx=0to9:print#3,hn$(x):print#3,hq$(x):next
  334. 8265 close3:close15:goto5043
  335. 8270 ms$="":gosub5300:ifqf=1thendr=dv:gosub5115:goto8240
  336. 8275 return
  337. 8300 rem    ***** high score check *****
  338. 8305 gosub5030:cf=0:ifah=3oras=0then8330
  339. 8310 w=-1:forx=9to0step-1:ifas>val(hq$(x))thenw=x:cf=1
  340. 8315 next:ifw<0then8330
  341. 8320 forx=9towstep-1:hq$(x+1)=hq$(x):hn$(x+1)=hn$(x):next
  342. 8325 hq$(w)=str$(as):hn$(w)=""
  343. 8330 gosub5030:ms$=hf$+" [195]hampions:-":h=1:v=13:gosub5070
  344. 8335 forx=4to0step-1:v=18-x
  345. 8340 h=1:ms$=hn$(4-x):gosub5070:h=12:ms$=hq$(4-x):gosub5070
  346. 8345 h=20:ms$=hn$(9-x):gosub5070:h=32:ms$=hq$(9-x):gosub5070:next
  347. 8350 ifah=3oras=0orw<0thenreturn
  348. 8355 ms$="[195]ongratulations! [197]nter your name!":gosub5205
  349. 8360 v=14+w:ifv>18thenv=14+(w-5)
  350. 8365 h=20:ifw<5thenh=1
  351. 8370 gosub5015:ll=10:gosub5705:ifw$=""then8370
  352. 8375 hn$(w)=w$:gosub8250:gosub5043:gc%=1:goto7805
  353. 8400 rem    ***** hi-score clear *****
  354. 8405 forx=0to9:hn$(x)="..........":hq$(x)=" 00000":next:return
  355. 8430 rem    ***** hi-score select records/file check *****
  356. 8435 ifah=3orts%=0orgc%=1then8440
  357. 8436 ifuc%>1thenls%=4
  358. 8437 ifuc%>29thenls%=5
  359. 8438 z$(1)="1. [212]ry for the "+hl$(ls%)+" [200]onours [204]ist.":goto8445
  360. 8440 z$(1)="1. [206]/[193]"
  361. 8445 z$(2)="2. [210]eview "+hl$(ls%)+" [200]onours [204]ist."
  362. 8450 z$(3)="3. [195]lear "+hl$(ls%)+" [200]onours [204]ist."
  363. 8455 z$(4)="4. [210]eview other listings.":z$(5)="5. [210]eturn to [200]eadquarters."
  364. 8460 df$="hs.convoy"+fl$(ls%):dr=dv:gosub5115:return
  365. 8500 rem    ***** hall of fame *****
  366. 8505 ah=1:gosub8405:gosub8205:ifqf=2then1050
  367. 8510 ss=6:ss$="s":gosub5405:print"[147]":bd=8:bk=1:ch=0:gosub5005
  368. 8515 sysad+3,0,39,12,12,170,0
  369. 8516 sysad+3,0,39,20,20,170,0
  370. 8520 ms$="[195][207][206][214][207][217] [200][193][204][204] [207][198] [198][193][205][197][144]":v=0:gosub5210
  371. 8525 ms$="[199]ood day "+nm$+".":v=2:gosub5210:b$=""
  372. 8526 ifts%=0orgc%=1orah=3then8535
  373. 8528 gosub8605:v=3:ms$=pd$:gosub5210:v=4:ms$=el$(el%):gosub5210
  374. 8529 ifhr>3thenms$=sh$(hr-3):v=5:gosub5210
  375. 8530 ts$=str$(ts%):b$="[217]ou have scored"+ts$+". "
  376. 8535 ms$=b$+"[196]o you wish to:-":v=6:gosub5210
  377. 8540 h=6:forv=7to11:gosub5045:ms$=z$(v-6):gosub5070:next
  378. 8545 ms$="[211]elect 1 to 5.":cs=3:gosub5300:f%=val(a$):iff%<1orf%>5then8545
  379. 8550 gosub5030:onf%goto8555,8565,8570,8655,8595
  380. 8556 ifts%=0orgc%=1orah=3thengosub6985:goto8545
  381. 8560 as=ts%:gosub8305:goto8545
  382. 8565 as=0:gosub8305:goto8545
  383. 8570 as=0:gosub8305
  384. 8575 ms$="[195]lear list and disk file? (y/n)":cs=2:gosub5300
  385. 8580 ifqf=2then8545
  386. 8585 gosub5255:ifqf=2then8545
  387. 8590 gosub5030:gosub8405:gosub8250:goto8545
  388. 8595 ifgf=1then1005
  389. 8596 print"[147]":ss=6:ss$="r":gosub5405:goto1050
  390. 8600 rem    ***** set admiralty judgement *****
  391. 8605 el$(1)="[193]dmiral of the [198]leet.":el$(2)="[193]dmiral.":el$(3)="[214]ice [193]dmiral."
  392. 8610 el$(4)="[210]ear [193]dmiral.":el$(5)="[195]ommodore.":el$(6)="[193]cting [195]ommodore."
  393. 8615 el$(7)="[195]aptain.":el$(8)="[204]ieutenant.":el$(9)="[208]etty [207]fficer"
  394. 8620 el$(10)="[211]wabby (ordinary seaman).":el$(11)="land based latrine duty."
  395. 8625 pd$="[217]ou have been promoted to":ifel%=6thenpd$="[217]ou retain your rank as"
  396. 8630 ifel%>6thenpd$="[217]ou have been demoted to"
  397. 8635 return
  398. 8650 rem    ***** select listing *****
  399. 8655 gosub5034:gosub5030:h=1:ms$="[211]elect listing to check:-":v=14:gosub5070
  400. 8660 ms$="1. [197]xperienced [195]onvoy commander.":v=15:gosub5070
  401. 8665 ms$="2. [197]xperienced [195]apt. [198]irst [195]onvoy.":v=16:gosub5070
  402. 8670 ms$="3. [202]ust out of [206]aval [193]cademy.":v=17:gosub5070
  403. 8675 ms$="4. [203]night [207]rder of the [194]ath.":v=18:gosub5070
  404. 8680 ms$="5. [214]ictoria [195]ross.":v=19:gosub5070
  405. 8685 a$="":geta$:ifval(a$)<1orval(a$)>5then8675
  406. 8690 ls%=val(a$):ah=3:gosub8205:gosub5030:b$="":goto8535
  407. 10000 dv=peek(186):open15,dv,15,"s:harbour":close15
  408. 10005 save"harbour",dv:end
  409. 20000 a%=rnd(0)*12+1:printa%
  410.