home *** CD-ROM | disk | FTP | other *** search
- 1 rem "gozo basic" 2001.06.26
- 2 poke55,192:poke56,55:clr
- 3 gosub3002
- 4 gosub12:onq%goto4002
- 5 q%=3:gosub102
- 6 gosub12:onq%goto4002,5
- 7 onp%(p%,1)gosub144
- 8 gosub180:onq%goto4002,5,5,5,4
- 10 :
- 12 : rem input
- 14 :
- 16 pokevl+39,1
- 18 sysml+9:i%=cr%:on1+(i%=0)goto22:sysml+60,"pehq":on1+(i%=0)goto22
- 20 onp%(p%,1)+1goto18,24
- 22 oni%gosub502,524,574,590,160:ifq%>2thenonp%(p%,1)goto24:ifb%=-1then18
- 24 ifq%=5then18
- 26 pokevl+39,7
- 28 return
- 100 :
- 102 : rem next move
- 104 :
- 106 b%=-1:m%=m%+1:sysml+12,sx%+4,sy%+11,"[205]ove "+right$(str$(m%),2):return
- 108 :
- 110 : rem next player
- 112 :
- 114 poke646,c%(1):cy%=fnyp(p%):gosub128
- 116 sysml+129,gw+73,gw+98,gv+815:rem save "o" pattern
- 118 p%=1-p%:poke646,c%(6+p%):cy%=fnyp(p%):gosub128:poke646,c%(2):pokegv+1,p%
- 120 return
- 122 :
- 124 : rem player pointer
- 126 :
- 128 sysml+12,sx%,cy%,"\":sysml+12,sx%+16,cy%,"_":return
- 130 :
- 132 : rem status line
- 134 :
- 136 l%=17:sysml+30,sx%+1,sx%+15,cy%,cy%,160,c%(1)
- 138 poke646,cc%:sysml+12,fnxc(sx%),cy%,a$:poke646,c%(2)
- 140 return
- 142 :
- 144 : rem computer
- 146 :
- 148 pokegv,0:sysgl:b%=peek(2+38144)
- 150 gosub212
- 152 rem --- pointer
- 154 sysml+24,o%(2,0):sysml+21,fnx(0),fny(0):sysml+24,o%(2,0)
- 156 return
- 158 :
- 160 : rem human move
- 162 :
- 164 br%=(cy%-by%)/3:bc%=(cx%-bx%)/3
- 166 c%=(br%+1)*8+(bc%+1)
- 168 if(c%and1)=(br%and1)then176
- 170 ifpeek(gw+c%)=16then176
- 172 ifpeek(gv+35)=0thenb%=b%+(b%-c%)*(c%<>36):goto176
- 174 pokegv,1:pokegv+3,c%:sysgl:b%=b%+(b%-c%)*(peek(10+38144)=1)
- 176 return
- 178 :
- 180 : rem results
- 182 :
- 184 rem --- move
- 186 cc%=c%(6+p%):gosub232:rem display
- 188 pokegv,2:pokegv+3,b%:sysgl:rem board
- 190 rem --- display
- 192 n%=peek(28+38144)-1:ifn%=-1thengosub110:goto208
- 194 cc%=c%(6+p%):x=gv+62
- 196 fori=0ton%:b%=peek(x+i):gosub212:gosub232:p%(p%,0)=p%(p%,0)+1:next
- 198 pokegv+5+p%,p%(p%,0):ifp%(p%,0)>12thenpokegv+4,1
- 200 cx%=sx%+9*p%+4:cy%=sy%+13:h%=p%(p%,0)/10:l%=p%(p%,0)-h%*10
- 202 poke646,c%(6+p%):i%=l%*2+1:gosub220:ifh%>0thencx%=cx%-2:i%=h%*2+1:gosub220
- 204 poke646,c%(2)
- 206 ifm%=25thengosub240:rem over
- 208 return
- 210 :
- 212 : rem sq row & col for fnx & fny
- 214 :
- 216 br%=b%/8:bc%=b%-br%*8:br%=br%-1:bc%=bc%-1:return
- 218 :
- 220 : rem print 2x2 number
- 222 :
- 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)
- 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
- 228 return
- 230 :
- 232 : rem block paint
- 234 :
- 236 cx%=fnx(0):cy%=fny(0):sysml+30,cx%,cx%+2,cy%,cy%+2,255,cc%:return
- 238 :
- 240 : rem game over
- 242 :
- 244 q%=5:ifp%(0,0)=p%(1,0)thencc%=c%(2):a$="[212]ie":goto248
- 246 p%=1+(p%(0,0)>p%(1,0)):cc%=c%(6+p%):a$="[215]in"
- 248 cy%=15:gosub132
- 250 return
- 500 :
- 502 : rem play new game
- 504 :
- 506 q%=2:m%=0:p%(0,0)=0:p%(1,0)=0:p%=1:gosub110
- 508 sysml+30,sx%,sx%+16,sy%+11,sy%+15,160,c%(1)
- 510 sysml+48,bx%,bx%+20,by%,by%+20,a(0):sysml+129,a(1),a(1)+99,gw
- 512 pokegv+4,0:pokegv+5,0:pokegv+6,0:pokegv+35,0:pokegv+61,0:pokegv+815,0
- 514 sys49280:rem random "b" list
- 520 return
- 522 :
- 524 : rem edit setup
- 526 :
- 528 gosub636
- 530 sysml+42,hs%:pokemv,ls%:pokemv+2,14
- 532 n%=0
- 534 sysml+9:ifcr%=0thensysml+60,"q":oni%+1goto534,566
- 536 ifcr%=14then566
- 538 ifcr%<12then550
- 540 i=cr%-12
- 542 w$=n$(i):sysml+156,p%(i,3)+128,p%(i,4),c%(1),c%(1),p%(i,2),0,"[145]",n$(i)
- 544 ifn$(i)=w$then534
- 546 n%=n%ord%(i+3)
- 548 n$(i)=w$:goto534
- 550 forj=0to2:i=2-j:f%=(cr%>=o%(i,1)):j=j+(j-2)*f%:next
- 552 ifo%(i,2)=cr%then534
- 554 n%=n%ord%(i)
- 556 i%=o%(i,2):gosub3540:i%=cr%:gosub3552:f%=cr%-o%(i,1):o%(i,2)=cr%
- 558 onigoto562,564
- 560 o%(0,0)=f%:goto534
- 562 o%(1,0)=(f%+1)*2:goto534
- 564 o%(2,0)=d%(f%)*60/2:goto534
- 566 sysml+39,hs%:gosub644
- 568 ifn%>0thengosub608
- 570 return
- 572 :
- 574 : rem help
- 576 :
- 578 gosub636
- 580 sysml+42,hh%:pokemv,lh%:pokemv+2,6
- 582 sysml+210,1+128,38,3,18,c%(2),0,c%(4),c%(5),0,"",""
- 584 gosub644
- 586 return
- 588 :
- 590 : rem quit
- 592 :
- 594 gosub636
- 596 sysml+42,hq%:pokemv,lq%:pokemv+2,2
- 598 sysml+9:i%=cr%:ifi%=0thensysml+60,"ny":ifi%=0then598
- 600 ifi%=2thenq%=1:goto604
- 602 gosub644
- 604 return
- 606 :
- 608 : rem new setup
- 610 :
- 612 rem --- human
- 614 if(n%andd%(0))=0then620
- 616 fori=0to1:p%(i,1)=1+((o%(0,0)andd%(i))<>0)
- 618 cc%=c%(2):cy%=fnyp(i)+1:a$=t$(p%(i,1)):gosub132:next
- 620 rem --- level
- 622 pokegv+2,o%(1,0)
- 624 rem --- names
- 626 fori=0to1:if(n%andd%(i+3))=0then630
- 628 cc%=c%(6+i):cy%=fnyp(i):a$=n$(i):gosub132
- 630 next
- 632 return
- 634 :
- 636 : rem stash game screen
- 638 :
- 640 sysml+39,hg%:return
- 642 :
- 644 : rem restore game screen
- 646 :
- 648 sysml+42,hg%:pokemv,lg%:pokemv+2,5:return
- 3000 :
- 3002 : rem initialize
- 3004 :
- 3006 rem --- dim
- 3008 dim b%,bc%,br%,bx%,by%,c%,cc%,cr%,cx%,cy%,f%,h%,hg%,hh%,hs%,hq%,i%
- 3010 dim l%,l1%,l2%,lg%,lh%,ls%,lq%,m%,n%,p%,pp%,px%,py%,q%
- 3012 dim r1%,r2%,rg%,sc%,sl%,sx%,sy%
- 3014 dim dv,gl,gv,gw,i,j,ml,mm,mv,vl,x,a$,f$,w$
- 3016 dim c%(7),d%(8),o%(2,2),p%(1,4),a(1),n$(1),t$(1)
- 3018 rem --- deffn
- 3020 deffnx(x)=bx%+bc%*3
- 3022 deffny(x)=by%+br%*3
- 3024 deffnxc(x)=x+(l%-len(a$))/2
- 3026 deffnyp(x)=sy%+5+3*x
- 3028 rem --- constants
- 3030 dv=peek(186):vl=53248:d%(0)=1:fori=1to8:d%(i)=d%(i-1)*2:next
- 3032 rem --- font
- 3034 readf%,a$,h%,l%:iff%thengosub3502
- 3036 rem --- mouse
- 3038 readf%,a$,h%,l%:iff%thengosub3502
- 3040 ml=l%+h%*d%(8):mv=ml+309
- 3042 pokemv+1,93:rem region hi byte
- 3044 lg%=0:lh%=lg%+5*4:ls%=lh%+6*4:lq%=ls%+14*4:rem region lo bytes
- 3046 hg%=224:hh%=232:hs%=240:hq%=248:rem stash pages
- 3048 n%=99:fori=42to49:n%=n%+1:pokemv+i,n%:next
- 3050 rem --- mouse mate
- 3052 readf%,a$,h%,l%:iff%thengosub3502
- 3054 mm=l%+h%*d%(8)
- 3056 pokemm+9,0:rem disable stop
- 3058 rem --- random
- 3060 readf%,a$,h%,l%:iff%thengosub3502
- 3062 poke176,l%:poke177,h%
- 3064 rem --- help text
- 3066 readf%,a$,h%,l%
- 3068 x=l%+h%*d%(8)
- 3070 iff%thensysml+201,a$,8,x
- 3072 sysml+204,x
- 3074 rem --- ml
- 3076 readf%,a$,h%,l%:iff%thengosub3502
- 3078 readf%,a$,h%,l%:iff%thengosub3502
- 3080 gl=l%+h%*d%(8):gv=95*d%(8):gw=gv+66:pokegv+881,85:pokegv+882,15
- 3082 readf%,a$,h%,l%:iff%thengosub3502
- 3084 readf%,a$,h%,l%:iff%thengosub3502
- 3086 fori=7to34:readx:pokegv+i,x:next
- 3088 rem --- memory locations
- 3090 a(0)=gv+883:a(1)=a(0)+882
- 3092 rem ---
- 3094 t$(0)="([200]uman)":t$(1)="([195]omputer)"
- 3096 fori=0to7:readc%(i):next
- 3098 rem --- screen off
- 3100 pokevl+17,11
- 3102 rem --- font
- 3104 pokevl+24,31
- 3106 rem --- setup
- 3108 pokemv,ls%:pokevl+32,c%(2):pokevl+33,c%(4)
- 3110 sysml+126,0,39,0,24,108,92,c%(2),c%(0):sysml+30,5,34,2,19,160,c%(0)
- 3112 poke646,c%(0):poke199,1
- 3114 fori=1to4:readcx%,cy%,a$:sysml+12,cx%,cy%,a$:next
- 3116 fori=1to11:i%=i:readcx%,cy%,l%,a$:gosub3524:next
- 3118 l%=16:fori=0to1:i%=12+i:readcx%,cy%,a$:gosub3524
- 3120 p%(i,2)=l%-1:p%(i,3)=cx%:p%(i,4)=cy%:n$(i)=a$:next
- 3122 l%=8:i%=14:readcx%,cy%,a$:gosub3510:gosub3540
- 3124 fori=0to2:reado%(i,0),o%(i,1),o%(i,2):i%=o%(i,2):gosub3548:next
- 3126 poke199,0
- 3128 sysml+39,hs%
- 3130 rem --- quit
- 3132 pokemv,lq%:pokevl+32,c%(2):pokevl+33,c%(4)
- 3134 sysml+126,0,39,0,24,108,92,c%(2),c%(0):sysml+30,10,29,6,15,160,c%(0)
- 3136 poke646,c%(0):poke199,1
- 3138 readcy%,a$:sysml+27,cy%,a$
- 3140 l%=7:fori=1to2:i%=i:readcx%,cy%,a$:gosub3510:gosub3540:next
- 3142 poke199,0
- 3144 sysml+39,hq%
- 3146 rem --- help
- 3148 pokemv,lh%:pokevl+32,c%(0):pokevl+33,c%(1)
- 3150 sysml+30,0,39,0,24,160,c%(0):sysml+30,0,39,2,19,160,c%(4)+16
- 3152 poke646,c%(0):poke199,1:readcy%,a$:sysml+27,cy%,a$:poke199,0
- 3154 x=1024+40*cy%:sysml+228,x+21,x+29,0
- 3156 poke646,c%(3):l%=8:fori=1to4:i%=i:readcx%,cy%,a$:gosub3510:next
- 3158 sysml+39,hh%
- 3160 rem --- game
- 3162 pokemv,lg%:pokevl+32,c%(0):pokevl+33,c%(1)
- 3164 sysml+30,0,39,0,24,160,c%(0)
- 3166 sx%=23:sy%=0:sysml+30,sx%,sx%+16,sy%,sy%+15,160,c%(1)
- 3168 poke646,c%(2)
- 3170 sysml+12,sx%+4,sy%+2,"[176][177][180][181][184][185][180][181]"
- 3172 sysml+12,sx%+4,sy%+3,"[178][179][182][183][186][187][182][183]"
- 3174 poke646,c%(3):l%=8:fori=1to4:i%=i:readcx%,cy%,a$:gosub3510:next
- 3176 bx%=0:by%=1
- 3178 sysml+15,5,bx%,bx%+20,by%,by%+20
- 3180 cc%=c%(1):f%=cc%+c%(3):poke646,cc%:rem light/dark (c%(1)/c%(3))
- 3182 fori=0to6:cy%=by%+i*3:forj=0to6:cx%=bx%+j*3:cc%=f%-cc%
- 3184 ifcc%=c%(3)thensysml+30,cx%,cx%+2,cy%,cy%+2,160,cc%:goto3188
- 3186 sysml+12,cx%,cy%,"[221][255][223]":sysml+12,cx%,cy%+1,"[173][174][175]":sysml+12,cx%,cy%+2,"[161][162][163]"
- 3188 next:next
- 3190 cx%=bx%+9:cy%=by%+9:sysml+126,cx%,cx%+2,cy%,cy%+2,91,219,c%(3),c%(3)
- 3192 sysml+45,bx%,bx%+20,by%,by%+20,a(0)
- 3194 c%=-1:f%=0:rem c%=sq# f%=light/dark(1/0)
- 3196 fori=0to8:forj=0to7:c%=c%+1:x=a(1)+c%:f%=1-f%
- 3198 ifi=0ori=8orj=0thenpokex,16:goto3212:rem out
- 3200 iff%thenpokex,32:goto3212:rem light
- 3202 ifi=1thenpokex,d%(0):goto3212:rem top
- 3204 ifj=7thenpokex,d%(1):goto3212:rem right
- 3206 ifi=7thenpokex,d%(2):goto3212:rem bottom
- 3208 ifj=1thenpokex,d%(3):goto3212:rem left
- 3210 pokex,0:rem none
- 3212 next:f%=1-f%:next:c%=c%+1:pokea(1)+c%,16
- 3214 fori=73to98:pokea(1)+i,0:next
- 3216 poke646,c%(2):n%=31:gosub608:q%=5
- 3218 sysml+39,hg%
- 3220 rem --- title screen
- 3222 pokevl+32,c%(0):pokevl+33,c%(1)
- 3224 sysml+126,0,39,0,24,91,219,c%(6),c%(7)
- 3226 sysml+30,3,35,5,13,160,c%(4)+16
- 3228 poke646,c%(3)
- 3230 sysml+27,6,"[176][177] [180][181] [184][185] [180][181]"
- 3232 sysml+27,7,"[178][179] [182][183] [186][187] [182][183]"
- 3234 poke646,c%(4)
- 3236 sysml+27,9,"by [204]ance [195]. [212]homas"
- 3238 sysml+27,11,"(c) 2001 [202] & [198] [208]ublishing, [201]nc."
- 3240 rem ---
- 3242 pokevl+17,27
- 3244 gosub3556
- 3246 poke198,0:wait198,15:poke198,0
- 3248 pokevl+17,11:sysml+42,hg%:pokevl+17,27
- 3250 gosub3556
- 3252 sysmm
- 3254 sysml
- 3256 sysml+6,192+55*d%(8)
- 3258 sysml+18,1,37,1,22
- 3260 poke646,c%(2)
- 3262 ifabs((peek(53433)and128)=128)=0thenpoke53374,0:poke53366,0:poke53375,0
- 3264 return
- 3500 :
- 3502 : rem bload file
- 3504 :
- 3506 sys57812a$,8,0:poke780,0:poke781,l%:poke782,h%:sys65493:return
- 3508 :
- 3510 : rem command button
- 3512 :
- 3514 sysml+15,i%,cx%,cx%+l%-1,cy%,cy%+2
- 3516 sysml+30,cx%,cx%+l%-1,cy%,cy%+2,160,c%(1)
- 3518 sysml+12,fnxc(cx%),cy%+1,a$
- 3520 return
- 3522 :
- 3524 : rem setup region
- 3526 :
- 3528 sysml+15,i%,cx%,cx%+l%-1,cy%,cy%
- 3530 ifi%<12thensysml+12,fnxc(cx%),cy%,a$:goto3534
- 3532 sysml+12,cx%,cy%,a$
- 3534 gosub3540
- 3536 return
- 3538 :
- 3540 : rem region highlight off
- 3542 :
- 3544 sysml+36,i%,255,c%(1):return
- 3546 :
- 3548 : rem region highlight on
- 3550 :
- 3552 sysml+36,i%,255,c%(5):return
- 3554 :
- 3556 : rem pause
- 3558 :
- 3560 i=ti
- 3562 ifti>ithenifti-i<20then3562
- 3564 return
- 4000 :
- 4002 : rem *** exit
- 4004 :
- 4006 sysml+3:pokevl+21,0
- 4008 sysmm+3
- 4009 ifabs((peek(53433)and128)=128)=0thenpoke53374,0:poke53367,0:poke53375,0
- 4010 goto40000
- 9000 :
- 9002 : *** data
- 9004 :
- 9006 data 00,"f.gozo",56,0
- 9008 data 00,"mouse2.1 7k 4000",64,0
- 9010 data 00,"mouse mate 5c00",92,0
- 9012 data 00,"random 2-254",94,0
- 9014 data 00,"t.gozo hlp",160,0
- 9016 data 00,"gozo pttrn",102,156
- 9018 data 00,"gozo ml01",149,128
- 9019 data 00,"gozo ml02",192,128
- 9020 data 00,"gozo ml03",194,0
- 9022 rem ---
- 9024 data 16,7,0,9:rem move step +8
- 9026 data 1,2,4,8,16,32,64,128:rem 2^
- 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
- 9030 rem ---
- 9032 data 12,15,11,6,0,2,0,2:rem c%()
- 9034 rem --- setup
- 9036 data 15,4,"[199][207][218][207] [211]etup"
- 9038 data 8,7,"[200]uman [204]evel [208]ause"
- 9040 data 7,13,"[206]ame ([194]lack)"
- 9042 data 7,16,"[206]ame ([210]ed)"
- 9044 data 7,8,7,"[206]one",7,9,7,"[194]lack",7,10,7,"[210]ed ",7,11,7,"[194]oth"
- 9046 data 18,8,5,"1",18,9,5,"2",18,10,5,"3"
- 9048 data 28,8,5,"1",28,9,5,"2",28,10,5,"4",28,11,5,"8"
- 9050 data 7,14,"[193]lphonse",7,17,"[199]aston"
- 9052 data 25,15,"[[209]]uit"
- 9054 data 1,1,2, 2,5,5, 60,8,9
- 9056 rem --- quit
- 9058 data 8,"[209]uit [199][207][218][207]?"
- 9060 data 12,11,"[[206]]o ",21,11,"[[217]]es"
- 9062 rem --- help
- 9064 data 0,"[199][207][218][207] [200]elp [204]ine #### of ####"
- 9066 data 1,21,"[[200][207][205][197]]",11,21,"[[213][208]]",21,21,"[[196][207][215][206]]",31,21,"[[209]]uit"
- 9068 rem --- game
- 9070 data 23,17,"[[208]]lay",32,17,"[[197]]dit",23,21,"[[200]]elp",32,21,"[[209]]uit"
- 9072 :
- 10000 a$="gozo basic"
- 10010 dv=8:open15,dv,15,"s0:"+a$:close15:savea$,dv:end
- 40000 fori=8to29:poke820+i,i:next:ifdv>8anddv<30thenpoke828,dv:poke820+dv,8
- 40010 a$="presenter":gosub40030:a$="hello connect":gosub40030
- 40020 print"[147]":poke53272,23:poke186,8:end
- 40030 forj=8to29:i=peek(820+j):ifi=14thennext
- 40040 close2:open2,i,2:close2:ifstthen40060
- 40050 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then40070
- 40060 next:return
- 40070 a$="hello connect":q$=chr$(34):poke646,peek(53281):print"[147]":poke53272,23
- 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
- 40090 print"run:":poke631,13:poke632,13:poke198,2:end
-