home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 206 / 206.d81 / b.gozo / b.080d / b.a7ae (.txt)
Encoding:
Commodore BASIC  |  2001-01-01  |  49.2 KB  |  391 lines

  1. 1 rem "gozo basic" 2001.06.26
  2. 2 poke55,192:poke56,55:clr
  3. 3 gosub3002
  4. 4 gosub12:onq%goto4002
  5. 5 q%=3:gosub102
  6. 6 gosub12:onq%goto4002,5
  7. 7 onp%(p%,1)gosub144
  8. 8 gosub180:onq%goto4002,5,5,5,4
  9. 10 :
  10. 12 : rem input
  11. 14 :
  12. 16 pokevl+39,1
  13. 18 sysml+9:i%=cr%:on1+(i%=0)goto22:sysml+60,"pehq":on1+(i%=0)goto22
  14. 20 onp%(p%,1)+1goto18,24
  15. 22 oni%gosub502,524,574,590,160:ifq%>2thenonp%(p%,1)goto24:ifb%=-1then18
  16. 24 ifq%=5then18
  17. 26 pokevl+39,7
  18. 28 return
  19. 100 :
  20. 102 : rem next move
  21. 104 :
  22. 106 b%=-1:m%=m%+1:sysml+12,sx%+4,sy%+11,"[205]ove  "+right$(str$(m%),2):return
  23. 108 :
  24. 110 : rem next player
  25. 112 :
  26. 114 poke646,c%(1):cy%=fnyp(p%):gosub128
  27. 116 sysml+129,gw+73,gw+98,gv+815:rem save "o" pattern
  28. 118 p%=1-p%:poke646,c%(6+p%):cy%=fnyp(p%):gosub128:poke646,c%(2):pokegv+1,p%
  29. 120 return
  30. 122 :
  31. 124 : rem player pointer
  32. 126 :
  33. 128 sysml+12,sx%,cy%,"\":sysml+12,sx%+16,cy%,"_":return
  34. 130 :
  35. 132 : rem status line
  36. 134 :
  37. 136 l%=17:sysml+30,sx%+1,sx%+15,cy%,cy%,160,c%(1)
  38. 138 poke646,cc%:sysml+12,fnxc(sx%),cy%,a$:poke646,c%(2)
  39. 140 return
  40. 142 :
  41. 144 : rem computer
  42. 146 :
  43. 148 pokegv,0:sysgl:b%=peek(2+38144)
  44. 150 gosub212
  45. 152 rem --- pointer
  46. 154 sysml+24,o%(2,0):sysml+21,fnx(0),fny(0):sysml+24,o%(2,0)
  47. 156 return
  48. 158 :
  49. 160 : rem human move
  50. 162 :
  51. 164 br%=(cy%-by%)/3:bc%=(cx%-bx%)/3
  52. 166 c%=(br%+1)*8+(bc%+1)
  53. 168 if(c%and1)=(br%and1)then176
  54. 170 ifpeek(gw+c%)=16then176
  55. 172 ifpeek(gv+35)=0thenb%=b%+(b%-c%)*(c%<>36):goto176
  56. 174 pokegv,1:pokegv+3,c%:sysgl:b%=b%+(b%-c%)*(peek(10+38144)=1)
  57. 176 return
  58. 178 :
  59. 180 : rem results
  60. 182 :
  61. 184 rem --- move
  62. 186 cc%=c%(6+p%):gosub232:rem display
  63. 188 pokegv,2:pokegv+3,b%:sysgl:rem board
  64. 190 rem --- display
  65. 192 n%=peek(28+38144)-1:ifn%=-1thengosub110:goto208
  66. 194 cc%=c%(6+p%):x=gv+62
  67. 196 fori=0ton%:b%=peek(x+i):gosub212:gosub232:p%(p%,0)=p%(p%,0)+1:next
  68. 198 pokegv+5+p%,p%(p%,0):ifp%(p%,0)>12thenpokegv+4,1
  69. 200 cx%=sx%+9*p%+4:cy%=sy%+13:h%=p%(p%,0)/10:l%=p%(p%,0)-h%*10
  70. 202 poke646,c%(6+p%):i%=l%*2+1:gosub220:ifh%>0thencx%=cx%-2:i%=h%*2+1:gosub220
  71. 204 poke646,c%(2)
  72. 206 ifm%=25thengosub240:rem over
  73. 208 return
  74. 210 :
  75. 212 : rem sq row & col for fnx & fny
  76. 214 :
  77. 216 br%=b%/8:bc%=b%-br%*8:br%=br%-1:bc%=bc%-1:return
  78. 218 :
  79. 220 : rem print 2x2 number
  80. 222 :
  81. 224 poke199,1+(i%=1):sysml+12,cx%,cy%,mid$("[188][189][220][221][160][161][164][165][168][169][172][173][176][177][180][181][184][185][188][189]",i%,2)
  82. 226 sysml+12,cx%,cy%+1,mid$("[190][191][255][223][162][163][166][167][170][171][174][175][178][179][182][183][186][187][190][191]",i%,2):poke199,0
  83. 228 return
  84. 230 :
  85. 232 : rem block paint
  86. 234 :
  87. 236 cx%=fnx(0):cy%=fny(0):sysml+30,cx%,cx%+2,cy%,cy%+2,255,cc%:return
  88. 238 :
  89. 240 : rem game over
  90. 242 :
  91. 244 q%=5:ifp%(0,0)=p%(1,0)thencc%=c%(2):a$="[212]ie":goto248
  92. 246 p%=1+(p%(0,0)>p%(1,0)):cc%=c%(6+p%):a$="[215]in"
  93. 248 cy%=15:gosub132
  94. 250 return
  95. 500 :
  96. 502 : rem play new game
  97. 504 :
  98. 506 q%=2:m%=0:p%(0,0)=0:p%(1,0)=0:p%=1:gosub110
  99. 508 sysml+30,sx%,sx%+16,sy%+11,sy%+15,160,c%(1)
  100. 510 sysml+48,bx%,bx%+20,by%,by%+20,a(0):sysml+129,a(1),a(1)+99,gw
  101. 512 pokegv+4,0:pokegv+5,0:pokegv+6,0:pokegv+35,0:pokegv+61,0:pokegv+815,0
  102. 514 sys49280:rem random "b" list
  103. 520 return
  104. 522 :
  105. 524 : rem edit setup
  106. 526 :
  107. 528 gosub636
  108. 530 sysml+42,hs%:pokemv,ls%:pokemv+2,14
  109. 532 n%=0
  110. 534 sysml+9:ifcr%=0thensysml+60,"q":oni%+1goto534,566
  111. 536 ifcr%=14then566
  112. 538 ifcr%<12then550
  113. 540 i=cr%-12
  114. 542 w$=n$(i):sysml+156,p%(i,3)+128,p%(i,4),c%(1),c%(1),p%(i,2),0,"[145]",n$(i)
  115. 544 ifn$(i)=w$then534
  116. 546 n%=n%ord%(i+3)
  117. 548 n$(i)=w$:goto534
  118. 550 forj=0to2:i=2-j:f%=(cr%>=o%(i,1)):j=j+(j-2)*f%:next
  119. 552 ifo%(i,2)=cr%then534
  120. 554 n%=n%ord%(i)
  121. 556 i%=o%(i,2):gosub3540:i%=cr%:gosub3552:f%=cr%-o%(i,1):o%(i,2)=cr%
  122. 558 onigoto562,564
  123. 560 o%(0,0)=f%:goto534
  124. 562 o%(1,0)=(f%+1)*2:goto534
  125. 564 o%(2,0)=d%(f%)*60/2:goto534
  126. 566 sysml+39,hs%:gosub644
  127. 568 ifn%>0thengosub608
  128. 570 return
  129. 572 :
  130. 574 : rem help
  131. 576 :
  132. 578 gosub636
  133. 580 sysml+42,hh%:pokemv,lh%:pokemv+2,6
  134. 582 sysml+210,1+128,38,3,18,c%(2),0,c%(4),c%(5),0,"",""
  135. 584 gosub644
  136. 586 return
  137. 588 :
  138. 590 : rem quit
  139. 592 :
  140. 594 gosub636
  141. 596 sysml+42,hq%:pokemv,lq%:pokemv+2,2
  142. 598 sysml+9:i%=cr%:ifi%=0thensysml+60,"ny":ifi%=0then598
  143. 600 ifi%=2thenq%=1:goto604
  144. 602 gosub644
  145. 604 return
  146. 606 :
  147. 608 : rem new setup
  148. 610 :
  149. 612 rem --- human
  150. 614 if(n%andd%(0))=0then620
  151. 616 fori=0to1:p%(i,1)=1+((o%(0,0)andd%(i))<>0)
  152. 618 cc%=c%(2):cy%=fnyp(i)+1:a$=t$(p%(i,1)):gosub132:next
  153. 620 rem --- level
  154. 622 pokegv+2,o%(1,0)
  155. 624 rem --- names
  156. 626 fori=0to1:if(n%andd%(i+3))=0then630
  157. 628 cc%=c%(6+i):cy%=fnyp(i):a$=n$(i):gosub132
  158. 630 next
  159. 632 return
  160. 634 :
  161. 636 : rem stash game screen
  162. 638 :
  163. 640 sysml+39,hg%:return
  164. 642 :
  165. 644 : rem restore game screen
  166. 646 :
  167. 648 sysml+42,hg%:pokemv,lg%:pokemv+2,5:return
  168. 3000 :
  169. 3002 : rem initialize
  170. 3004 :
  171. 3006 rem --- dim
  172. 3008 dim b%,bc%,br%,bx%,by%,c%,cc%,cr%,cx%,cy%,f%,h%,hg%,hh%,hs%,hq%,i%
  173. 3010 dim l%,l1%,l2%,lg%,lh%,ls%,lq%,m%,n%,p%,pp%,px%,py%,q%
  174. 3012 dim r1%,r2%,rg%,sc%,sl%,sx%,sy%
  175. 3014 dim dv,gl,gv,gw,i,j,ml,mm,mv,vl,x,a$,f$,w$
  176. 3016 dim c%(7),d%(8),o%(2,2),p%(1,4),a(1),n$(1),t$(1)
  177. 3018 rem --- deffn
  178. 3020 deffnx(x)=bx%+bc%*3
  179. 3022 deffny(x)=by%+br%*3
  180. 3024 deffnxc(x)=x+(l%-len(a$))/2
  181. 3026 deffnyp(x)=sy%+5+3*x
  182. 3028 rem --- constants
  183. 3030 dv=peek(186):vl=53248:d%(0)=1:fori=1to8:d%(i)=d%(i-1)*2:next
  184. 3032 rem --- font
  185. 3034 readf%,a$,h%,l%:iff%thengosub3502
  186. 3036 rem --- mouse
  187. 3038 readf%,a$,h%,l%:iff%thengosub3502
  188. 3040 ml=l%+h%*d%(8):mv=ml+309
  189. 3042 pokemv+1,93:rem region hi byte
  190. 3044 lg%=0:lh%=lg%+5*4:ls%=lh%+6*4:lq%=ls%+14*4:rem region lo bytes
  191. 3046 hg%=224:hh%=232:hs%=240:hq%=248:rem stash pages
  192. 3048 n%=99:fori=42to49:n%=n%+1:pokemv+i,n%:next
  193. 3050 rem --- mouse mate
  194. 3052 readf%,a$,h%,l%:iff%thengosub3502
  195. 3054 mm=l%+h%*d%(8)
  196. 3056 pokemm+9,0:rem disable stop
  197. 3058 rem --- random
  198. 3060 readf%,a$,h%,l%:iff%thengosub3502
  199. 3062 poke176,l%:poke177,h%
  200. 3064 rem --- help text
  201. 3066 readf%,a$,h%,l%
  202. 3068 x=l%+h%*d%(8)
  203. 3070 iff%thensysml+201,a$,8,x
  204. 3072 sysml+204,x
  205. 3074 rem --- ml
  206. 3076 readf%,a$,h%,l%:iff%thengosub3502
  207. 3078 readf%,a$,h%,l%:iff%thengosub3502
  208. 3080 gl=l%+h%*d%(8):gv=95*d%(8):gw=gv+66:pokegv+881,85:pokegv+882,15
  209. 3082 readf%,a$,h%,l%:iff%thengosub3502
  210. 3084 readf%,a$,h%,l%:iff%thengosub3502
  211. 3086 fori=7to34:readx:pokegv+i,x:next
  212. 3088 rem --- memory locations
  213. 3090 a(0)=gv+883:a(1)=a(0)+882
  214. 3092 rem ---
  215. 3094 t$(0)="([200]uman)":t$(1)="([195]omputer)"
  216. 3096 fori=0to7:readc%(i):next
  217. 3098 rem --- screen off
  218. 3100 pokevl+17,11
  219. 3102 rem --- font
  220. 3104 pokevl+24,31
  221. 3106 rem --- setup
  222. 3108 pokemv,ls%:pokevl+32,c%(2):pokevl+33,c%(4)
  223. 3110 sysml+126,0,39,0,24,108,92,c%(2),c%(0):sysml+30,5,34,2,19,160,c%(0)
  224. 3112 poke646,c%(0):poke199,1
  225. 3114 fori=1to4:readcx%,cy%,a$:sysml+12,cx%,cy%,a$:next
  226. 3116 fori=1to11:i%=i:readcx%,cy%,l%,a$:gosub3524:next
  227. 3118 l%=16:fori=0to1:i%=12+i:readcx%,cy%,a$:gosub3524
  228. 3120 p%(i,2)=l%-1:p%(i,3)=cx%:p%(i,4)=cy%:n$(i)=a$:next
  229. 3122 l%=8:i%=14:readcx%,cy%,a$:gosub3510:gosub3540
  230. 3124 fori=0to2:reado%(i,0),o%(i,1),o%(i,2):i%=o%(i,2):gosub3548:next
  231. 3126 poke199,0
  232. 3128 sysml+39,hs%
  233. 3130 rem --- quit
  234. 3132 pokemv,lq%:pokevl+32,c%(2):pokevl+33,c%(4)
  235. 3134 sysml+126,0,39,0,24,108,92,c%(2),c%(0):sysml+30,10,29,6,15,160,c%(0)
  236. 3136 poke646,c%(0):poke199,1
  237. 3138 readcy%,a$:sysml+27,cy%,a$
  238. 3140 l%=7:fori=1to2:i%=i:readcx%,cy%,a$:gosub3510:gosub3540:next
  239. 3142 poke199,0
  240. 3144 sysml+39,hq%
  241. 3146 rem --- help
  242. 3148 pokemv,lh%:pokevl+32,c%(0):pokevl+33,c%(1)
  243. 3150 sysml+30,0,39,0,24,160,c%(0):sysml+30,0,39,2,19,160,c%(4)+16
  244. 3152 poke646,c%(0):poke199,1:readcy%,a$:sysml+27,cy%,a$:poke199,0
  245. 3154 x=1024+40*cy%:sysml+228,x+21,x+29,0
  246. 3156 poke646,c%(3):l%=8:fori=1to4:i%=i:readcx%,cy%,a$:gosub3510:next
  247. 3158 sysml+39,hh%
  248. 3160 rem --- game
  249. 3162 pokemv,lg%:pokevl+32,c%(0):pokevl+33,c%(1)
  250. 3164 sysml+30,0,39,0,24,160,c%(0)
  251. 3166 sx%=23:sy%=0:sysml+30,sx%,sx%+16,sy%,sy%+15,160,c%(1)
  252. 3168 poke646,c%(2)
  253. 3170 sysml+12,sx%+4,sy%+2,"[176][177][180][181][184][185][180][181]"
  254. 3172 sysml+12,sx%+4,sy%+3,"[178][179][182][183][186][187][182][183]"
  255. 3174 poke646,c%(3):l%=8:fori=1to4:i%=i:readcx%,cy%,a$:gosub3510:next
  256. 3176 bx%=0:by%=1
  257. 3178 sysml+15,5,bx%,bx%+20,by%,by%+20
  258. 3180 cc%=c%(1):f%=cc%+c%(3):poke646,cc%:rem light/dark (c%(1)/c%(3))
  259. 3182 fori=0to6:cy%=by%+i*3:forj=0to6:cx%=bx%+j*3:cc%=f%-cc%
  260. 3184 ifcc%=c%(3)thensysml+30,cx%,cx%+2,cy%,cy%+2,160,cc%:goto3188
  261. 3186 sysml+12,cx%,cy%,"[221][255][223]":sysml+12,cx%,cy%+1,"[173][174][175]":sysml+12,cx%,cy%+2,"[161][162][163]"
  262. 3188 next:next
  263. 3190 cx%=bx%+9:cy%=by%+9:sysml+126,cx%,cx%+2,cy%,cy%+2,91,219,c%(3),c%(3)
  264. 3192 sysml+45,bx%,bx%+20,by%,by%+20,a(0)
  265. 3194 c%=-1:f%=0:rem c%=sq# f%=light/dark(1/0)
  266. 3196 fori=0to8:forj=0to7:c%=c%+1:x=a(1)+c%:f%=1-f%
  267. 3198 ifi=0ori=8orj=0thenpokex,16:goto3212:rem out
  268. 3200 iff%thenpokex,32:goto3212:rem light
  269. 3202 ifi=1thenpokex,d%(0):goto3212:rem top
  270. 3204 ifj=7thenpokex,d%(1):goto3212:rem right
  271. 3206 ifi=7thenpokex,d%(2):goto3212:rem bottom
  272. 3208 ifj=1thenpokex,d%(3):goto3212:rem left
  273. 3210 pokex,0:rem none
  274. 3212 next:f%=1-f%:next:c%=c%+1:pokea(1)+c%,16
  275. 3214 fori=73to98:pokea(1)+i,0:next
  276. 3216 poke646,c%(2):n%=31:gosub608:q%=5
  277. 3218 sysml+39,hg%
  278. 3220 rem --- title screen
  279. 3222 pokevl+32,c%(0):pokevl+33,c%(1)
  280. 3224 sysml+126,0,39,0,24,91,219,c%(6),c%(7)
  281. 3226 sysml+30,3,35,5,13,160,c%(4)+16
  282. 3228 poke646,c%(3)
  283. 3230 sysml+27,6,"[176][177] [180][181] [184][185] [180][181]"
  284. 3232 sysml+27,7,"[178][179] [182][183] [186][187] [182][183]"
  285. 3234 poke646,c%(4)
  286. 3236 sysml+27,9,"by [204]ance [195]. [212]homas"
  287. 3238 sysml+27,11,"(c) 2001 [202] & [198] [208]ublishing, [201]nc."
  288. 3240 rem ---
  289. 3242 pokevl+17,27
  290. 3244 gosub3556
  291. 3246 poke198,0:wait198,15:poke198,0
  292. 3248 pokevl+17,11:sysml+42,hg%:pokevl+17,27
  293. 3250 gosub3556
  294. 3252 sysmm
  295. 3254 sysml
  296. 3256 sysml+6,192+55*d%(8)
  297. 3258 sysml+18,1,37,1,22
  298. 3260 poke646,c%(2)
  299. 3262 ifabs((peek(53433)and128)=128)=0thenpoke53374,0:poke53366,0:poke53375,0
  300. 3264 return
  301. 3500 :
  302. 3502 : rem bload file
  303. 3504 :
  304. 3506 sys57812a$,8,0:poke780,0:poke781,l%:poke782,h%:sys65493:return
  305. 3508 :
  306. 3510 : rem command button
  307. 3512 :
  308. 3514 sysml+15,i%,cx%,cx%+l%-1,cy%,cy%+2
  309. 3516 sysml+30,cx%,cx%+l%-1,cy%,cy%+2,160,c%(1)
  310. 3518 sysml+12,fnxc(cx%),cy%+1,a$
  311. 3520 return
  312. 3522 :
  313. 3524 : rem setup region
  314. 3526 :
  315. 3528 sysml+15,i%,cx%,cx%+l%-1,cy%,cy%
  316. 3530 ifi%<12thensysml+12,fnxc(cx%),cy%,a$:goto3534
  317. 3532 sysml+12,cx%,cy%,a$
  318. 3534 gosub3540
  319. 3536 return
  320. 3538 :
  321. 3540 : rem region highlight off
  322. 3542 :
  323. 3544 sysml+36,i%,255,c%(1):return
  324. 3546 :
  325. 3548 : rem region highlight on
  326. 3550 :
  327. 3552 sysml+36,i%,255,c%(5):return
  328. 3554 :
  329. 3556 : rem pause
  330. 3558 :
  331. 3560 i=ti
  332. 3562 ifti>ithenifti-i<20then3562
  333. 3564 return
  334. 4000 :
  335. 4002 : rem *** exit
  336. 4004 :
  337. 4006 sysml+3:pokevl+21,0
  338. 4008 sysmm+3
  339. 4009 ifabs((peek(53433)and128)=128)=0thenpoke53374,0:poke53367,0:poke53375,0
  340. 4010 goto40000
  341. 9000 :
  342. 9002 : *** data
  343. 9004 :
  344. 9006 data 00,"f.gozo",56,0
  345. 9008 data 00,"mouse2.1 7k 4000",64,0
  346. 9010 data 00,"mouse mate 5c00",92,0
  347. 9012 data 00,"random 2-254",94,0
  348. 9014 data 00,"t.gozo hlp",160,0
  349. 9016 data 00,"gozo pttrn",102,156
  350. 9018 data 00,"gozo ml01",149,128
  351. 9019 data 00,"gozo ml02",192,128
  352. 9020 data 00,"gozo ml03",194,0
  353. 9022 rem ---
  354. 9024 data 16,7,0,9:rem move step +8
  355. 9026 data 1,2,4,8,16,32,64,128:rem 2^
  356. 9028 data 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4:rem number sides for sum = 0 to 15
  357. 9030 rem ---
  358. 9032 data 12,15,11,6,0,2,0,2:rem c%()
  359. 9034 rem --- setup
  360. 9036 data 15,4,"[199][207][218][207]  [211]etup"
  361. 9038 data 8,7,"[200]uman     [204]evel     [208]ause"
  362. 9040 data 7,13,"[206]ame     ([194]lack)"
  363. 9042 data 7,16,"[206]ame       ([210]ed)"
  364. 9044 data 7,8,7,"[206]one",7,9,7,"[194]lack",7,10,7,"[210]ed ",7,11,7,"[194]oth"
  365. 9046 data 18,8,5,"1",18,9,5,"2",18,10,5,"3"
  366. 9048 data 28,8,5,"1",28,9,5,"2",28,10,5,"4",28,11,5,"8"
  367. 9050 data 7,14,"[193]lphonse",7,17,"[199]aston"
  368. 9052 data 25,15,"[[209]]uit"
  369. 9054 data 1,1,2, 2,5,5, 60,8,9
  370. 9056 rem --- quit
  371. 9058 data 8,"[209]uit [199][207][218][207]?"
  372. 9060 data 12,11,"[[206]]o ",21,11,"[[217]]es"
  373. 9062 rem --- help
  374. 9064 data 0,"[199][207][218][207] [200]elp [204]ine #### of ####"
  375. 9066 data 1,21,"[[200][207][205][197]]",11,21,"[[213][208]]",21,21,"[[196][207][215][206]]",31,21,"[[209]]uit"
  376. 9068 rem --- game
  377. 9070 data 23,17,"[[208]]lay",32,17,"[[197]]dit",23,21,"[[200]]elp",32,21,"[[209]]uit"
  378. 9072 :
  379. 10000 a$="gozo basic"
  380. 10010 dv=8:open15,dv,15,"s0:"+a$:close15:savea$,dv:end
  381. 40000 fori=8to29:poke820+i,i:next:ifdv>8anddv<30thenpoke828,dv:poke820+dv,8
  382. 40010 a$="presenter":gosub40030:a$="hello connect":gosub40030
  383. 40020 print"[147]":poke53272,23:poke186,8:end
  384. 40030 forj=8to29:i=peek(820+j):ifi=14thennext
  385. 40040 close2:open2,i,2:close2:ifstthen40060
  386. 40050 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then40070
  387. 40060 next:return
  388. 40070 a$="hello connect":q$=chr$(34):poke646,peek(53281):print"[147]":poke53272,23
  389. 40080 print"[147]p[207]2048,0:p[207]44,8:p[207]43,1:p[207]56,160:p[207]55,0:clr:l[207]"q$a$q$","i
  390. 40090 print"run:":poke631,13:poke632,13:poke198,2:end
  391.