home *** CD-ROM | disk | FTP | other *** search
- 1 rem "dots.bas" 2001.12.11
- 2 poke55,192:poke56,53:clr
- 3 gosub3002
- 4 gosub12:onq%goto4002
- 7 q%=3:gosub102:gosub12:onq%goto4002,7:onp%(p%,1)gosub164:gosub218
- 8 onq%goto4002,7,7,7,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,26
- 22 ifi%<5thenoni%gosub502,528,580,596:onq%goto28,28:goto20
- 24 ifp%(p%,1)=0thengosub190:ifb%=-1then18
- 26 ifq%=5then18
- 28 pokevl+39,7
- 30 return
- 100 :
- 102 : rem move
- 104 :
- 106 m%=m%+1:sysml+12,sx%+10,sy%+13,right$(str$(m%),2):a%=-1:b%=-1:return
- 108 :
- 110 : rem score
- 112 :
- 114 poke646,c%(5+p%)
- 116 sysml+12,sx%+12,sy%+10+p%,right$(str$(p%(p%,0)),2)
- 118 poke646,c%(2)
- 120 pokegv+138+p%,p%(p%,0)
- 122 return
- 124 :
- 126 : rem player
- 128 :
- 130 cc%=c%(1):gosub142:p%=1-p%:cc%=c%(5+p%):gosub142:poke646,c%(2)
- 132 pokegu+30,p%:rem p
- 134 return
- 136 :
- 138 : rem player pointer
- 140 :
- 142 poke646,cc%:cy%=fnyp(p%):sysml+12,sx%,cy%,"\":sysml+12,sx%+16,cy%,"_":return
- 144 :
- 146 : rem status line
- 148 :
- 150 l%=17
- 152 sysml+30,sx%+1,sx%+16,cy%,cy%,160,c%(1)
- 154 iff%thenpoke646,cc%
- 156 sysml+12,fnxc(sx%),cy%,f$
- 158 iff%thenpoke646,c%(2)
- 160 return
- 162 :
- 164 : rem computer
- 166 :
- 168 ifn%then176:continue capture
- 170 sysga+81:rem find move in-p out-n
- 172 n%=peek(gu+26)
- 174 ifpeek(gu+27)theni%=rnd(0)*n%:n%=0:goto178:random list
- 176 i%=peek(gu+26)-n%:n%=n%-1
- 178 x=gv+16+i%+i%:a%=peek(x):b%=a%+peek(x+1)
- 180 cc%=c%(5+p%)
- 182 cx%=fnx(a%):cy%=fny(a%):sysml+21,cx%,cy%:gosub264:gosub272
- 184 sysml+21,fnx(b%),fny(b%)
- 186 return
- 188 :
- 190 : rem human
- 192 :
- 194 i%=cr%+1:f%=60
- 196 if(peek(gw+i%)andf%)=f%then214
- 198 cx%=fnx(i%):cy%=fny(i%)
- 200 ifa%=-1thena%=i%:cc%=c%(5+p%):gosub264:goto214
- 202 ifi%=a%thena%=-1:cc%=c%(3):gosub264:goto214:cancel
- 204 c%=abs(i%-a%):ifc%<>1andc%<>6then214
- 206 f%=4:ifc%=6thenf%=8
- 208 ifa%<i%thenf%=f%*4
- 210 if(peek(gw+i%)andf%)=f%then214
- 212 n%=0:b%=i%:ifa%>i%thenb%=a%:a%=i%
- 214 return
- 216 :
- 218 : rem results
- 220 :
- 222 cc%=c%(3)
- 224 cx%=fnx(b%):cy%=fny(b%):gosub264
- 226 cx%=fnx(a%):cy%=fny(a%):gosub264
- 228 c%=b%-a%:ifc%=6thency%=cy%+2:goto232
- 230 cx%=cx%+2
- 232 gosub264:ifp%(p%,1)thengosub272
- 234 pokegu,a%:pokegu+4,c%:rem a,c
- 236 pokegu+22,0:pokegu+23,0:rem l
- 238 x=gv+177:gosub280:pokegu+32,l%:pokegu+33,h%:rem q
- 240 sysga+84:rem update board in-a,c,l out-l
- 242 l%=peek(gu+22)
- 244 sysgb+188:rem update patterns in-a,c,q
- 246 ifl%=0thengosub126:goto260
- 248 cc%=c%(5+p%):x=gv+136
- 250 c%=peek(x):cx%=fnx(c%)+2:cy%=fny(c%)+2:gosub264
- 252 ifl%=1then256
- 254 c%=peek(x+1):cx%=fnx(c%)+2:cy%=fny(c%)+2:gosub264
- 256 p%(p%,0)=p%(p%,0)+l%:gosub110
- 258 ifp%(p%,0)<13then260
- 259 q%=5:f%=-1:cc%=c%(5+p%):cy%=sy%+15:f$="[199]ame [207]ver":gosub146:pokevl+32,cc%
- 260 return
- 262 :
- 264 : rem paint 2x2 block
- 266 :
- 268 sysml+30,cx%,cx%+1,cy%,cy%+1,255,cc%:return
- 270 :
- 272 : rem pause
- 274 :
- 276 sysml+24,o%(2,0):return
- 278 :
- 280 : rem low/high byte
- 282 :
- 284 h%=x/d%(8):l%=x-h%*d%(8):return
- 500 :
- 502 : rem play new game
- 504 :
- 506 pokevl+32,c%(1):q%=2:m%=0:n%=0
- 508 sysml+48,bx%,bx%+21,by%,by%+21,a(0)
- 510 sysml+129,a(1),a(1)+42,gw
- 512 cc%=c%(1):gosub138:poke646,c%(2):rem player pointer
- 514 fori=0to1:p%=i:p%(p%,0)=0:gosub110:next:rem score
- 516 sysml+30,sx%+1,sx%+16,sy%+15,sy%+15,160,c%(1):rem game over
- 518 pokegu+36,0:rem s
- 520 x=gv+176:fori=0to64:pokex+i,0:next
- 522 gosub126
- 524 return
- 526 :
- 528 : rem edit setup
- 530 :
- 532 gosub646
- 534 sysml+42,hs%:pokemv,ls%:pokemv+2,13:pokevl+17,27
- 536 d%=0
- 538 sysml+9:ifcr%=0thensysml+60,"q":oni%+1goto538,572
- 540 ifcr%=13then572
- 542 ifcr%<11then554
- 544 i=cr%-11
- 546 w$=n$(i):sysml+156,p%(i,3)+128,p%(i,4),c%(1),c%(1),p%(i,2),0,"[145]",n$(i)
- 548 ifn$(i)=w$then538
- 550 d%=d%ord%(i+3)
- 552 n$(i)=w$:goto538
- 554 forj=0to2:i=2-j:f%=(cr%>=o%(i,1)):j=j+(j-2)*f%:next
- 556 ifo%(i,2)=cr%then538
- 558 d%=d%ord%(i)
- 560 i%=o%(i,2):cc%=c%(1):gosub3530:i%=cr%:cc%=c%(4):gosub3530
- 562 f%=cr%-o%(i,1):o%(i,2)=cr%
- 564 onigoto568,570
- 566 o%(0,0)=f%:goto538
- 568 o%(1,0)=f%+1:goto538
- 570 o%(2,0)=d%(f%)*60/2:goto538
- 572 sysml+39,hs%:gosub654
- 574 ifd%>0thengosub614
- 576 return
- 578 :
- 580 : rem help
- 582 :
- 584 gosub646
- 586 sysml+42,hh%:pokemv,lh%:pokemv+2,6:pokevl+17,27
- 588 sysml+210,1+128,38,3,18,c%(2),0,c%(3),c%(4),0,"",""
- 590 gosub654
- 592 return
- 594 :
- 596 : rem quit
- 598 :
- 600 gosub646
- 602 sysml+42,hq%:pokemv,lq%:pokemv+2,2:pokevl+17,27
- 604 sysml+9:i%=cr%:ifi%=0thensysml+60,"ny":ifi%=0then604
- 606 ifi%=2thenq%=1:goto610
- 608 gosub654
- 610 return
- 612 :
- 614 : rem new setup
- 616 :
- 618 rem --- human
- 620 if(d%andd%(0))=0then630
- 622 fori=0to1
- 624 p%(i,1)=1+((o%(0,0)andd%(i))<>0)
- 626 f%=0:cy%=fnyp(i)+1:f$=t$(p%(i,1)):gosub146
- 628 next
- 630 rem --- level
- 632 if(d%andd%(1))>0thenpokegu+14,o%(1,0)
- 634 rem --- names
- 636 fori=0to1:if(d%andd%(i+3))=0then640
- 638 f%=-1:cy%=fnyp(i):cc%=c%(5+i):f$=n$(i):gosub146
- 640 next
- 642 return
- 644 :
- 646 : rem stash game screen
- 648 :
- 650 pokevl+17,11:sysml+39,hg%:return
- 652 :
- 654 : rem restore game screen
- 656 :
- 658 pokevl+17,11:sysml+42,hg%:pokemv,lg%:pokemv+2,40:pokevl+17,27:return
- 3000 :
- 3002 : rem initialize
- 3004 :
- 3006 rem --- dim
- 3008 dim a%,b%,bx%,by%,c%,cc%,cr%,cx%,cy%,d%,f%,h%,h0%,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,ga,gb,gu,gv,gw,i,j,ml,mm,mv,vl,x,f$,w$
- 3016 dim c%(6),d%(8),o%(2,2),p%(1,4),a(1),n$(1),t$(1)
- 3018 rem --- deffn
- 3020 deffnxc(x)=x+(l%-len(f$))/2
- 3022 deffnx(x)=peek(h0%*d%(8)-8+x*4)
- 3024 deffny(x)=peek(h0%*d%(8)-6+x*4)
- 3026 deffnyp(x)=sy%+4+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%,f$,h%,l%:iff%thengosub3502
- 3036 rem --- mouse
- 3038 readf%,f$,h%,l%:ml=l%+h%*d%(8):mv=ml+309:iff%thengosub3502
- 3040 h0%=55:pokemv+1,h0%:rem region hi byte
- 3042 lg%=0:lh%=lg%+40*4:ls%=lh%+6*4:lq%=ls%+13*4:rem region lo bytes
- 3044 hg%=224:hh%=232:hs%=240:hq%=248:rem stash pages
- 3046 n%=98:fori=42to49:n%=n%+1:pokemv+i,n%+128:next
- 3048 rem --- mouse mate
- 3050 readf%,f$,h%,l%:mm=l%+h%*d%(8):iff%thengosub3502
- 3052 pokemm+9,0:rem disable stop
- 3054 rem --- ml
- 3056 readf%,f$,h%,l%:iff%thengosub3502
- 3058 readf%,f$,h%,l%:ga=l%+h%*d%(8):iff%thengosub3502
- 3060 readf%,f$,h%,l%:gb=l%+h%*d%(8):iff%thengosub3502
- 3062 sysga:sysgb:rem init var
- 3064 rem --- memory locations
- 3066 a(0)=192*d%(8):a(1)=a(0)+968
- 3068 gu=196*d%(8):gv=gu+52+52:gw=gv+306
- 3070 x=gw:gosub280:pokegu+44,l%:pokegu+45,h%:rem w
- 3072 x=1344:gosub280:pokegu+52+26,l%:pokegu+52+27,h%:rem table count (var2 n)
- 3074 rem --- help text
- 3076 readf%,f$,h%,l%:x=l%+h%*d%(8):iff%thensysml+201,f$,8,x
- 3078 sysml+204,x
- 3080 rem ---
- 3082 t$(0)="([200]uman)":t$(1)="([195]omputer)"
- 3084 fori=0to6:readc%(i):next
- 3086 rem --- screen off
- 3088 pokevl+17,11
- 3090 rem --- font
- 3092 pokevl+24,31
- 3094 rem --- box/frame
- 3096 n%=98or128:fori=42to49:n%=n%+1:pokemv+i,n%:next
- 3098 rem --- setup
- 3100 pokemv,ls%:pokevl+32,c%(2):pokevl+33,c%(3)
- 3102 sysml+126,0,39,0,24,160,160,c%(2),c%(2)
- 3104 sysml+30,8,32,1,23,160,c%(0)or16
- 3106 sysml+30,9,31,2,22,160,c%(0)
- 3108 poke646,c%(0):poke199,1
- 3110 fori=1to4:readcx%,cy%,f$:sysml+12,cx%,cy%,f$:next
- 3112 cc%=c%(1):fori=1to10:i%=i:readcx%,cy%,l%,f$:gosub3522:next
- 3114 l%=16:fori=0to1:i%=11+i:readcx%,cy%,f$:gosub3522
- 3116 p%(i,2)=l%-1:p%(i,3)=cx%:p%(i,4)=cy%:n$(i)=f$:next
- 3118 l%=8:i%=13:readcx%,cy%,f$:gosub3510:gosub3530
- 3120 cc%=c%(4):fori=0to2:reado%(i,0),o%(i,1),o%(i,2):i%=o%(i,2):gosub3530:next
- 3122 poke199,0
- 3124 sysml+30,11,12,12,13,96,c%(5)
- 3126 sysml+30,11,12,15,16,96,c%(6)
- 3128 sysml+39,hs%
- 3130 rem --- quit
- 3132 pokemv,lq%:pokevl+32,c%(2):pokevl+33,c%(3)
- 3134 sysml+126,0,39,0,24,160,160,c%(2),c%(2)
- 3136 sysml+30,10,29,6,15,160,c%(0)or16
- 3138 sysml+30,11,28,7,14,160,c%(0)
- 3140 poke646,c%(0):poke199,1
- 3142 readcx%,cy%,f$:sysml+12,cx%,cy%,f$
- 3144 l%=7:cc%=c%(1):fori=1to2:i%=i:readcx%,cy%,f$:gosub3510:gosub3530:next
- 3146 poke199,0
- 3148 sysml+39,hq%
- 3150 rem --- box/frame
- 3152 n%=98:fori=42to49:n%=n%+1:pokemv+i,n%:next
- 3154 rem --- help
- 3156 pokemv,lh%:pokevl+32,c%(0):pokevl+33,c%(1)
- 3158 sysml+30,0,39,0,24,160,c%(0):sysml+30,0,39,2,19,160,c%(3)+16
- 3160 poke646,c%(0):poke199,1:readcy%,f$:sysml+27,cy%,f$:poke199,0
- 3162 x=1024+40*cy%:sysml+228,x+21,x+29,0
- 3164 poke646,c%(3):l%=8:fori=1to4:i%=i:readcx%,cy%,f$:gosub3510:next
- 3166 sysml+39,hh%
- 3168 rem --- game
- 3170 pokemv,lg%:pokevl+32,c%(1):pokevl+33,c%(1)
- 3172 sysml+30,0,39,0,24,160,c%(1)
- 3174 sx%=23:sy%=0
- 3176 sysml+30,sx%,sx%+16,sy%,sy%+15,160,c%(1)
- 3178 poke646,c%(2):poke199,1
- 3180 sysml+12,sx%+3,sy%+1,"[171][172][160][175][176][160][179][180][160][183][184]"
- 3182 sysml+12,sx%+3,sy%+2,"[173][174][160][177][178][160][181][182][160][185][186]":poke199,0
- 3184 f%=-1:cc%=c%(5):cy%=sy%+10:f$="[195]aptures 0":gosub146
- 3186 f%=-1:cc%=c%(6):cy%=sy%+11:f$="[195]aptures 0":gosub146
- 3188 f%=0:cy%=sy%+13:f$="[205]ove 0":gosub146
- 3190 bx%=0:by%=1
- 3192 poke646,c%(1)
- 3194 fori=0to5:cy%=by%+4*i
- 3196 sysml+12,bx%,cy%+0,"[171][172][164][164][171][172][164][164][171][172][164][164][171][172][164][164][171][172][164][164][171][172]"
- 3198 sysml+12,bx%,cy%+1,"[173][174][163][163][173][174][163][163][173][174][163][163][173][174][163][163][173][174][163][163][173][174]"
- 3200 next
- 3202 fori=0to4:cy%=by%+4*i+2
- 3204 sysml+12,bx%,cy%+0,"[166][165][160][160][166][165][160][160][166][165][160][160][166][165][160][160][166][165][160][160][166][165]"
- 3206 sysml+12,bx%,cy%+1,"[166][165][160][160][166][165][160][160][166][165][160][160][166][165][160][160][166][165][160][160][166][165]"
- 3208 next
- 3210 poke646,c%(3):l%=8:fori=1to4:i%=i:readcx%,cy%,f$:gosub3510:next
- 3212 fori=0to5:cy%=by%+4*i
- 3214 forj=0to5:cx%=bx%+4*j:i%=i%+1
- 3216 sysml+15,i%,cx%,cx%+1,cy%,cy%+1
- 3218 sysml+36,i%,255,c%(3)
- 3220 next:next
- 3222 fori=0to15:readn%:pokegv+i,n%:next
- 3224 x=gv+168:fori=0to7:pokex+i,d%(i):next
- 3226 forx=gwtogw+5:pokex,64:next
- 3228 x=gw+5:forj=0to5:fori=0to5:f%=0
- 3230 ifi=0thenf%=f%or16:goto3234
- 3232 ifi=5thenf%=f%or64or4
- 3234 ifj=0thenf%=f%or32:goto3238
- 3236 ifj=5thenf%=f%or64or8
- 3238 x=x+1:pokex,f%:next:next
- 3240 sysml+45,bx%,bx%+21,by%,by%+21,a(0)
- 3242 sysml+129,gw,gw+42,a(1)
- 3244 poke646,c%(2):d%=31:gosub614:q%=5
- 3246 sysml+39,hg%
- 3248 rem --- title
- 3250 pokevl+32,c%(0):pokevl+33,c%(1)
- 3252 sysml+126,0,39,0,24,160,160,c%(0),c%(0)
- 3254 sysml+30,3,35,5,13,160,c%(3)or16
- 3256 poke646,c%(3):poke199,1
- 3258 sysml+27,6,"[171][172][160][175][176][160][179][180][160][183][184]"
- 3260 sysml+27,7,"[173][174][160][177][178][160][181][182][160][185][186]":poke199,0
- 3262 poke646,c%(2)
- 3264 sysml+27,9,"(c) 2001 [202] & [198] [208]ublishing, [201]nc."
- 3266 sysml+27,11,"by [204]ance [195]. [212]homas"
- 3268 rem ---
- 3270 pokevl+17,27:gosub3538
- 3272 poke198,0:wait198,15:poke198,0
- 3274 gosub654:gosub3538
- 3276 sysmm:sysml:sysml+6,13760
- 3278 sysml+18,1,37,1,22:poke646,c%(2)
- 3280 ifabs((peek(53433)and128)=128)=0thenpoke53374,0:poke53366,0:poke53375,0
- 3282 return
- 3500 :
- 3502 : rem bload file
- 3504 :
- 3506 sys57812f$,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%(3)or16:sysml+12,fnxc(cx%),cy%+1,f$
- 3518 return
- 3520 :
- 3522 : rem setup region
- 3524 :
- 3526 sysml+15,i%,cx%,cx%+l%-1,cy%,cy%:sysml+12,cx%,cy%,f$:gosub3530:return
- 3528 :
- 3530 : rem paint region
- 3532 :
- 3534 sysml+36,i%,255,cc%:return
- 3536 :
- 3538 : rem pause
- 3540 :
- 3542 i=ti
- 3544 ifti>ithenifti-i<20then3544
- 3546 return
- 4000 :
- 4002 : rem *** exit
- 4004 :
- 4006 sysml+3:pokevl+21,0:sysmm+3
- 4009 ifabs((peek(53433)and128)=128)=0thenpoke53374,0:poke53367,0:poke53375,0
- 4010 goto40000
- 9000 :
- 9002 : *** data
- 9004 :
- 9006 data 00,"f.dots",56,0
- 9008 data 00,"mouse2.1 7k 4000",64,0
- 9010 data 00,"mouse mate 3600",54,0
- 9012 data 00,"dots pttrn",92,0
- 9014 data 00,"dotsa.zml",134,0
- 9016 data 00,"dotsb.zml",199,0
- 9018 data 00,"t.dots hlp",160,0
- 9020 rem ---
- 9022 data 12,15,11,0,2,6,2:rem c%()
- 9024 rem --- setup
- 9026 data 15,3,"[196]ots [211]etup"
- 9028 data 11,6,"[200]uman [204]evel [208]ause"
- 9030 data 14,12,"[206]ame ([194]lue)"
- 9032 data 14,15,"[206]ame ([210]ed)"
- 9034 data 11,7,5,"[206]one",11,8,5,"[194]lue",11,9,5,"[210]ed",11,10,5,"[194]oth"
- 9036 data 18,7,5," 1",18,8,5," 2"
- 9038 data 25,7,5," 0",25,8,5," 1",25,9,5," 2",25,10,5," 4"
- 9040 data 14,13,"[197]lhanan",14,16,"[204]ahmi"
- 9042 data 22,19,"[[209]]uit"
- 9044 data 1,1,2, 1,5,5, 30,7,8
- 9046 rem --- quit
- 9048 data 15,8,"[209]uit [196]ots?"
- 9050 data 12,11,"[[206]]o ",21,11,"[[217]]es"
- 9052 rem --- help
- 9054 data 0,"[196]ots [200]elp [204]ine #### of ####"
- 9056 data 1,21,"[[200][207][205][197]]",11,21,"[[213][208]]",21,21,"[[196][207][215][206]]",31,21,"[[209]]uit"
- 9058 rem --- game
- 9060 data 23,17,"[[208]]lay",32,17,"[[197]]dit",23,21,"[[200]]elp",32,21,"[[209]]uit"
- 9062 data 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4
- 9999 :
- 10000 a$="dots.bas":ifdv<8ordv>29thendv=8
- 10010 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:poke53280,11:poke53281,0:poke646,13: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
-