home *** CD-ROM | disk | FTP | other *** search
Wrap
1 rem "queen basic" 2000.09.10 2 poke55,0:poke56,55:clr 3 gosub3002 4 gosub12:onq%goto4002 5 q%=3:gosub102 6 gosub12:onq%goto4002,5 7 onp%(p%,1)gosub142 8 gosub186: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,162:ifq%>2thenonp%(p%,1)goto24:ifb%=-1then18 24 ifq%=5then18 26 pokevl+39,7 28 return 100 : 102 : rem next player 104 : 106 a%=b%:b%=-1 108 rem --- player 110 p%=1-p%:a$="\ "+n$(p%)+" _":gosub120 112 rem --- move # 114 m%=m%+1:cy%=14:a$="[205]ove"+right$(" "+str$(m%),4):gosub132 116 return 118 : 120 : rem update player line 122 : 124 l%=24:sysml+30,xb%,xb%+l%-1,0,0,160,c%(1) 126 poke646,c%(6):sysml+12,fnxc(xb%),0,a$:poke646,c%(2) 128 return 130 : 132 : rem update status block 134 : 136 l%=15:sysml+30,xs%,xs%+l%-1,cy%,cy%,160,c%(1):sysml+12,fnxc(xs%),cy%,a$ 138 return 140 : 142 : rem find computer move 144 : 146 ifm%=1thenb%=b%(rnd(1)*(12+10*(o%(1,0)=3))):goto156 148 b%=a%(a%):ono%(1,0)goto150,152,154 150 ifb%=29orb%=43thenb%=-1 152 ifb%=39orb%=60thenb%=-1 154 ifb%=-1thenb%=a%-d%(rnd(1)*3) 156 cx%=fnx(b%):cy%=fny(b%) 157 sysml+24,o%(2,0):sysml+21,cx%+1,cy%+1:sysml+24,o%(2,0) 158 return 160 : 162 : rem check human move 164 : 166 b%=(int((cy%-yb%)/3))*8+int((cx%-xb%)/3) 168 ifm%=1thenf%=(fnr(b%)=7orfnc(b%)=7):goto178 170 f%=(b%<a%):ifnotf%then178 172 f%=(fnr(b%)=fnr(a%)):iff%then178 174 f%=(fnc(b%)=fnc(a%)):iff%then178 176 c%=a%-b%:f%=(int(c%/9)*9=c%) 178 ifnotf%thenb%=-1:goto182 180 cx%=fnx(b%):cy%=fny(b%) 182 return 184 : 186 : rem display move results 188 : 190 rem --- queen 192 gosub206 194 rem --- win 198 ifb%=0thenq%=5:a$=n$(p%)+" wins":gosub120 202 return 204 : 206 : rem position crown (sprite 3 & 4) 208 : 210 py%=cy%*8+52:px%=cx%*8+24:c%=0:ifpx%>255thenpx%=px%-256:c%=12 212 pokevl+4,px%:pokevl+5,py%:pokevl+6,px%:pokevl+7,py%:pokevl+16,c% 213 pokevl+21,15 214 return 500 : 502 : rem play new game 504 : 506 q%=2:m%=0:p%=1:gosub512 508 return 510 : 512 : rem new board 514 : 516 pokevl+21,3 518 sysml+48,xb%,xb%+23,yb%,yb%+23,a(0) 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%or2^(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%or2^i 556 i%=o%(i,2):gosub3540:i%=cr%:gosub3552:f%=cr%-o%(i,1):o%(i,2)=cr% 558 onigoto562,564 560 o%(i,0)=f%:goto534 562 o%(i,0)=f%+1:goto534 564 o%(i,0)=2^f%*30:goto534 566 sysml+39,hs%:gosub646 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 gosub646 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 gosub646 604 return 606 : 608 : rem new setup 610 : 612 rem --- human 614 if(n%and1)=0then624 616 fori=0to1 618 p%(i,1)=1+((o%(0,0)and2^i)<>0) 620 cy%=8+3*i:a$=t$(p%(i,1)):gosub132 622 next 624 rem --- name(s) 626 fori=0to1:if(n%and2^(i+3))=0then630 628 poke646,c%(6):cy%=7+3*i:a$=n$(i):gosub132:poke646,c%(2) 630 next 632 return 634 : 636 : rem stash game screen 638 : 640 pokea(1),peek(vl+21):pokevl+21,3:sysml+39,hg% 642 return 644 : 646 : rem restore game screen 648 : 650 sysml+42,hg%:pokemv,lg%:pokemv+2,5:pokevl+21,peek(a(1)) 652 return 3000 : 3002 : rem initialize 3004 : 3006 dv=peek(186) 3008 rem --- dim 3010 dim a%,b%,cc%,c%,cr%,cx%,cy%,f%,h%,hg%,hh%,hs%,hq%,i%,l%,l1%,l2% 3012 dim lg%,lh%,ls%,lq%,m%,n%,p%,pp%,px%,py%,q%,r1%,r2%,rg%,sc%,sl%,xb%,xs%,yb% 3014 dim cl,i,j,ml,mm,mv,vl,a$,f$,w$ 3016 dim a%(63),b%(11),c%(6),d%(2),o%(2,2),p%(1,4),a(1),n$(1),t$(1) 3018 rem --- deffn 3020 deffnr(x)=int(x/8) 3022 deffnc(x)=x-fnr(x)*8 3023 deffnx(x)=xb%+fnc(x)*3 3024 deffny(x)=yb%+fnr(x)*3 3025 deffnxc(x)=x+(l%-len(a$))/2 3026 rem --- sprite 3028 readf%,a$,h%,l% 3030 iff%thengosub3502 3032 rem --- font 3034 readf%,a$,h%,l% 3036 iff%thengosub3502 3038 rem --- mouse 3040 readf%,a$,h%,l% 3042 iff%thengosub3502 3044 ml=h%*256+l% 3046 mv=ml+309 3048 pokemv+1,97 3050 lg%=0:lh%=lg%+5*4:ls%=lh%+6*4:lq%=ls%+14*4:rem region low bytes 3052 hg%=224:hh%=232:hs%=240:hq%=248:rem stash pages 3054 n%=98:fori=42to49:n%=n%+1:pokemv+i,n%:next 3056 rem --- mouse mate 3058 readf%,a$,h%,l% 3060 iff%thengosub3502 3062 mm=h%*256+l% 3064 pokemm+9,0:rem disable stop 3066 rem --- curtain 3068 readf%,a$,h%,l% 3070 iff%thengosub3502 3072 cl=h%*256+l% 3074 rem --- help text 3076 readf%,a$,h%,l% 3078 i=h%*256+l% 3080 iff%thensysml+201,a$,dv,i 3082 sysml+204,i 3084 rem --- memory locations 3086 a(0)=98*256:a(1)=a(0)+1152 3088 rem --- vic location 3090 vl=53248 3092 rem --- 3094 t$(0)="([200]uman)":t$(1)="([195]omputer)" 3096 fori=0to11:readb%(i):next 3098 fori=0to2:readd%(i):next 3100 fori=0to63:reada%(i):next 3102 fori=0to6:readc%(i):next 3104 rem --- screen off 3106 pokevl+17,11 3108 rem --- font 3110 pokevl+24,31 3112 rem --- setup screen 3114 pokemv,ls%:pokevl+32,c%(2):pokevl+33,c%(4) 3116 sysml+126,0,39,0,24,93,95,c%(2),c%(0):sysml+30,5,34,2,19,160,c%(0) 3119 poke646,c%(0):poke199,1 3120 fori=1to4:readcx%,cy%,a$:sysml+12,cx%,cy%,a$:next 3122 fori=1to11:i%=i:readcx%,cy%,l%,a$:gosub3524:next 3124 l%=16:fori=0to1:i%=12+i:readcx%,cy%,a$:gosub3524 3126 p%(i,2)=l%-1:p%(i,3)=cx%:p%(i,4)=cy%:n$(i)=a$:next 3128 l%=8:i%=14:readcx%,cy%,a$:gosub3510:gosub3540 3130 fori=0to2:reado%(i,0),o%(i,1),o%(i,2):i%=o%(i,2):gosub3548:next 3132 poke199,0 3134 sysml+39,hs% 3136 rem --- quit screen 3138 pokemv,lq%:pokevl+32,c%(2):pokevl+33,c%(4) 3140 sysml+126,0,39,0,24,93,95,c%(2),c%(0):sysml+30,10,29,6,15,160,c%(0) 3142 poke646,c%(0):poke199,1 3144 readcy%,a$:sysml+27,cy%,a$ 3146 l%=7:fori=1to2:i%=i:readcx%,cy%,a$:gosub3510:gosub3540:next 3148 poke199,0 3150 sysml+39,hq% 3152 rem --- help screen 3154 pokemv,lh%:pokevl+32,c%(0):pokevl+33,c%(1) 3156 sysml+30,0,39,0,24,160,c%(0):sysml+30,0,39,2,19,160,c%(4)+16 3158 poke646,c%(0):poke199,1:readcy%,a$:sysml+27,cy%,a$:poke199,0 3160 sysml+228,1024+40*cy%+22,1024+40*cy%+30,0 3162 poke646,c%(3):l%=8:fori=1to4:i%=i:readcx%,cy%,a$:gosub3510:next 3164 sysml+39,hh% 3166 rem --- game screen 3168 pokemv,lg%:pokevl+32,c%(0):pokevl+33,c%(1) 3170 sysml+30,0,39,0,24,160,c%(0) 3172 xs%=25:sysml+30,xs%,xs%+14,1,15,160,c%(1) 3174 poke646,c%(2):poke199,1:a$="[176][177][178][179][180][181][180][181][182][183]":sysml+12,xs%+2,3,a$ 3176 a$="[184][185][186][187][188][189][188][189][190][191]":sysml+12,xs%+2,4,a$:poke199,0 3178 poke646,c%(3):l%=6:fori=1to4:i%=i:readcx%,cy%,a$:gosub3510:next 3180 xb%=0:yb%=1:sysml+15,5,xb%,xb%+23,yb%,yb%+23 3182 sysml+30,xb%,xb%+23,0,0,160,c%(1) 3184 sysml+36,5,160,10 3186 f%=1:fori=0to7:cy%=yb%+i*3:f%=1-f%:forj=1to7step2:cx%=xb%+(j-f%)*3 3188 sysml+30,cx%,cx%+2,cy%,cy%+2,160,2:next:next 3190 sysml+45,xb%,xb%+23,yb%,yb%+23,a(0):rem board 3192 poke646,c%(2):gosub502:q%=5:n%=31:gosub608 3194 sysml+39,hg% 3196 rem --- title screen 3198 pokevl+32,c%(0) 3200 pokevl+33,c%(1) 3202 sysml+126,0,39,0,24,92,94,c%(0),c%(2) 3204 sysml+30,3,35,5,13,160,c%(4)+16 3206 poke646,c%(3) 3208 poke199,1 3210 a$="[176][177][178][179][180][181][180][181][182][183]":sysml+27,6,a$ 3212 a$="[184][185][186][187][188][189][188][189][190][191]":sysml+27,7,a$ 3214 poke199,0 3216 poke646,c%(4) 3218 sysml+27,9,"by [204]ance [195]. [212]homas" 3220 sysml+27,11,"(c) 2000 [202][160]& [198] [208]ublishing, [201]nc." 3222 rem --- 3224 syscl 3226 pokevl+17,27 3228 gosub3556 3230 syscl+6 3232 poke198,0:wait198,15:poke198,0 3234 syscl+9 3236 pokevl+17,11:sysml+42,hg%:pokevl+17,27 3238 gosub3556 3240 syscl+6 3242 syscl+3 3244 sysmm 3246 sysml 3248 sysml+6,55*256 3250 sysml+18,1,37,1,22 3252 poke2042,222:pokevl+41,c%(6):poke2043,223:pokevl+42,7 3254 poke646,c%(2) 3256 return 3500 : 3502 : rem bload file 3504 : 3506 sys57812a$,dv,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 4008 pokevl+21,0 4010 sysmm+3 4012 poke646,11 4014 goto40000 9000 : 9002 : *** data 9004 : 9006 data 00,"spr.queen",55,128 9008 data 00,"f.queen",56,0 9010 data 00,"mouse2.1 7k 4000",64,0 9012 data 00,"mouse mate 6000",96,0 9014 data 00,"curtain 5c00",92,0 9016 data 00,"t.queen hlp",103,0 9018 rem --- 9020 data 39, 60, 15,23,31,47,55, 57,58,59,61,62 9022 data 1,8,9 9024 data -1,00,00,00,00,00,00,00, 00,00,-1,10,10,10,10,10 9026 data 00,-1,00,10,17,17,17,17, 00,17,17,00,17,-1,29,29 9028 data 00,17,10,17,00,10,29,-1, 00,17,10,-1,17,00,10,29 9030 data 00,17,10,43,43,17,00,10, 00,17,10,43,-1,43,17,00 9032 rem --- 9034 data 12,15,11,6,0,2,0:rem c%() 9036 rem --- setup 9038 data 14,4,"[209]ueen [211]etup" 9040 data 9,7,"[200]uman [204]evel [208]ause" 9042 data 7,13,"[206]ame ([208]layer 1)" 9044 data 7,16,"[206]ame ([208]layer 2)" 9046 data 7,8,10,"[206]one",7,9,10,"[208]layer 1",7,10,10,"[208]layer 2",7,11,10,"[194]oth" 9048 data 20,8,5,"1",20,9,5,"2",20,10,5,"3" 9050 data 28,8,5,"1",28,9,5,"2",28,10,5,"4",28,11,5,"8" 9052 data 7,14,"[205]aster [216]",7,17,"[203]nees [195]alhoon" 9054 data 25,15,"[[209]]uit" 9056 data 1,1,2, 3,5,7, 30,8,8 9058 rem --- quit 9060 data 8,"[209]uit [209]ueen?" 9062 data 12,11,"[[206]]o ",21,11,"[[217]]es" 9064 rem --- help 9066 data 0,"[209]ueen [200]elp [204]ine #### of ####" 9068 data 1,21,"[[200][207][205][197]]",11,21,"[[213][208]]",21,21,"[[196][207][215][206]]",31,21,"[[209]]uit" 9070 rem --- game 9072 data 26,17,"[173][184][185][186][187][188]",33,17,"[173][189][190][191][177][178]",26,21,"[173][179][180][181][182][183]",33,21,"[173][174][175][176][177][178]" 9999 : 10000 a$="queen basic" 10010 dv=peek(186):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:poke2048,0:poke44,8:poke43,1: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