home *** CD-ROM | disk | FTP | other *** search
- 1 poke650,64:printchr$(142):goto9630
- 2 sys49236:return
- 3 n=fnb(k):t=peek(b+10+k):m=fnv(k):q=peek(964+k):pr=peek(984+k):t2=13-peek(c+k):return
- 4 fort=1to99:next:return
- 5 fort=1to2500:next:return
- 7 iftb>zthenifnot((z=3orz=4)andtb<8)thenz=tb
- 8 goto3532
- 9 x=c%-(13*(d-1))+1:return
- 10 gosub49:kx=t+k:kc=fnb(k):kd=fnv(k):gosub18:ky=t+k:dx=peek(853+k)
- 12 e=peek(849+k):pr=peek(980+k):q=peek(960+k):jm=peek(839+k):return
- 15 t=49700+(u-1)*17:return
- 17 t=.-(u>.)*(6+(u-1)*8):return
- 18 t=abs(3-u)*2+968:return
- 19 ws=ps:gosub8500:r=w+s:return
- 20 poke53281,1:poke53280,6:return
- 21 sys49623:return
- 22 g=t%-(ws-1)*13+1:gosub23:sys50427:z=peek(896):return
- 23 poke899,t%:poke900,ws*13+1:return
- 24 u=fnq(gb):gosub63:return
- 26 x=fnq(z):ifzthenprint"[144]";:ifx=2orx=3thenprint"";
- 27 return
- 28 u=fnz(u):gosub30:return
- 30 v=b:gosub15:b=t:return
- 31 printtab(11):gosub33:gosub92:gosub87:return
- 33 print" [144][216][218] ";:return
- 34 gosub35:sys51061:y=peek(898):return
- 35 sys51192+(k-1)*11:poke897,x:return
- 36 gosub38:poke900,k*13+1:poke899,y
- 37 sys50435:w=peek(896):return
- 38 poke898,1:poke897,3:return
- 39 j=.:gosub2:sys49353:x=13:t=49582:e=49500+(u-1)*x:ifr(.)=1andb%<>2thenreturn
- 40 form=4to1step-1:gosub56:s=x*(m-1):print:printtab(o)z$(m)" [144]";
- 41 d=.:ifj<xthend=peek(e+j):ifd=.then45
- 42 ifd<=sthen46
- 43 pokea+4,129:ifpos(.)>o+xthenprintchr$(x);:printtab(o+3);
- 44 poket,d-s:syst+20:pokea+4,128
- 45 j=j+1:ifj<xthen41
- 46 next:gosub2:return
- 49 t=972-abs(u-3)*2:return
- 50 u=op:gosub148:gosub31:printtab(9)" is dealing the hand ":gosub143:return
- 51 gosub2:pokea+24,15:return
- 52 poke198,.:return
- 53 gosub35:sys51788:y=peek(898):return
- 55 gosub340:m=s
- 56 printchr$(144+116*(m=2orm=3));:return
- 57 x=u:gosub53:gosub36:return
- 58 ifmstheno=ms+4:gosub181
- 59 return
- 60 print"";:ifdn=.thenprint:return
- 61 print" "z$(5+dn):return
- 62 print"";:poke214,y-1:print:return
- 63 gosub99:printchr$(31-q);:return
- 65 pokex,peek(x)orfnx(k):return
- 66 gosub67:goto8
- 67 q=.:x=fnq(gb):iffnq(o)=.then71
- 68 q=int(o/5)*5:o=o-q:ifo>xthenz=((int(gb/5)*5)+o)+q:return
- 69 z=((int(gb/5)+1)*5)+o:ifqthenz=z+q
- 70 return
- 71 ifx=.thenz=gb+5+o:return
- 72 z=((int(gb/5)+1)*5)+o:return
- 73 l=gb:gosub201:pl=y:gosub209:return
- 74 gosub157:goto158
- 76 q=.:iftrtheniffnb(tr)+peek(c+tr)<13thenreturn
- 77 forj=1to4:iffnb(j)theniffnb(j)+peek(c+j)=13thenifj<>trthenq=1
- 78 next:return
- 79 d=.:ifmsthenifkx>21orkx=14orkx=15thenifkc>6or(ms>2andkc>5)thend=1
- 80 return
- 81 gosub52:gosub967:return
- 82 u=pl:gosub99:pokec+5+q,peek(c+5+q)+14-peek(c):pokec,13:fx=99:return
- 83 gosub955:gosub55:poke49582,c%-(m-1)*13:printz$(m);:sys49581:gosub315:return
- 84 t=49582:poket,y:syst+28:return
- 85 sl=99:gosub52:print" new contract[146] ";:gosub226
- 86 gb=z:d=.:print:print" [149]declarer [146] ";:gosub963:pl=d:dn=.:return
- 87 print" [211][144][193]":return
- 90 printspc(2);:foru=5to6:gosub92:next:print"=> *";:return
- 91 poke50106,y:y=tb:gosub62:gosub63:gosub17:printtab(o):return
- 92 gosub63:gosub17:pokec-19,t:sysc-20:pokec-11,.:return
- 95 y=32:gosub91:pokec-19,t:sys50097:gosub143:pokec-11,.:return
- 96 x=.:forj=1to4:x=x+peek(i+j):next:sx=r(.)-fx:ifxandx>=sxthenr=.:return
- 97 r=sx-x:return
- 98 gosub8300:d=.:gosub8360:return
- 99 q=(uand1)and1:return
- 101 x=1:d=.:t=asc(a$)+128
- 102 forl=1to4:ift=asc(z$(l))thenx=.:d=l
- 103 next:return
- 104 gosub250:ifa$="@"thenprint"[157]"a$:gosub82:x=1
- 105 ifa$=chr$(43)thenx=2
- 106 return
- 107 d=14:gosub108:d=d+(d>.):return
- 108 t=49566:poket,d:poke896,asc(a$):syst-1:d=peek(t):return
- 109 l=peek(c+tr)+fnb(tr)+fnv(tr):return
- 110 gosub776:tb=(t*(30+10*(f=1orf=2))-10*(f=.))*2^dn:return
- 113 tb=.:ifpb=.orpb>35thenreturn
- 114 x=gb:gb=pb:gosub110:gb=x:return
- 115 l=49271:x=a+14:pokex+5,48:pokex+6,170:y=6-u
- 116 forj=ytoy-1step-1:pokex,peek(l+5+j):pokex+1,peek(l+j):pokex+4,33:gosub4:pokex+4,32:next:return
- 117 gosub110:f=(deand1)and1:iftb+c%(3+f)<100orc%(5+f)=.then8
- 118 gosub121:ifythenifgb<11oro>fnq(gb)then4396
- 119 goto8
- 120 a%=1:poke51578,0:gosub2107:gosub955:goto827
- 121 y=.:s=peek(b+15):f=peek(b+16):ifstheno=s:y=1:iffthenifpeek(b+s)>3ands>2thenreturn
- 122 ifftheno=f:y=1:ifsthenifpeek(b+f)<5or(peek(b+s)>=peek(b+f)andfnb(s)>6)theno=s
- 123 return
- 132 gosub30:gosub981:return
- 133 x=.:ifgc=.or(gc=2andde=.)thenifu=dboru=plthenx=1:return
- 134 ifgc=2thenifde=1thenifu=4thenx=1:return
- 135 ifgc=4thenif(de=.and(u=2oru=4oru=1))or(deand(u=1oru=3oru=4))thenx=1
- 136 return
- 137 x=.:ifgc=.orgc=4thenreturn
- 138 ifde=1thenifu=dboru=plthenx=1
- 139 return
- 140 gosub955:poke900,6-(uand1):sys51538:gosub827:sys51522:return
- 141 gosub2000:gosub83:return
- 142 sys51504:return
- 143 gosub51:gosub115:gosub2:return
- 146 gosub51:pokea+1,y:pokea+5,43:pokea+15,5:pokea+4,20:pokea+4,21:return
- 148 y=9:gosub62:return
- 149 ms=.-(wt=leorwt=pb):return
- 151 gosub155:sys49803:gosub152:return
- 152 c%=peek(l-2):d=peek(l+2):return
- 153 gosub155:poke49900,t%:sys49903:gosub152:return
- 155 gosub205:pokel+1,12+(u-1)*13:return
- 156 gosub205:pokel+1,(u-1)*13:return
- 157 gosub156:sys50003:gosub152:return
- 158 poke49500+peek(49801),.:return
- 162 ifzandz<36thengosub26:poke49582,int((z-1)/5):sys49581:printz$(fnq(z));:return
- 163 printz$(5-1*(z=36)-2*(z=37));:return
- 164 gosub5:gosub300:print"":gosub776:s=peek(c+5+(pland1))-6-t
- 168 gosub894:ifs>=.thenprint" overtricks [146][144]"s:goto170
- 169 print" down [146][144]"abs(s)
- 170 pokec,.:gosub52:print"[149] deal hand again? ";:gosub90:gosub967:a%=.:yx=.:ifu=5then184
- 172 ifcithen908
- 173 ifgbthenifb%=.andgcthenon1+yxgoto439,438
- 174 op=fny(op):print"[147]":goto9651
- 175 gosub180:print"[147]":goto1005
- 180 print" ";:u=op:gosub92:print"[149] dealt. who opens? [146] ";:gosub963:op=d:return
- 181 ifms<>psandms<>prthenifpeek(b+ms)<5thenreturn
- 182 ifpeek(b+o)>4thendb=db+1+((peek(b+o)-5)*2)
- 183 w=v+db:return
- 184 print" rebid hand? ";:gosub90:gosub81:ifa$="n"thenpokec,99:goto1005
- 185 ifgc=4thenpokec,98
- 186 ifcithengc=2:b%=.
- 187 goto175
- 188 gosub73:goto219
- 190 gosub370:gosub400:return
- 191 forj=1to4:iffnb(j)=.andj<>sxthenx=x+1
- 192 next:return
- 193 wt=u:t%=c%:gosub340:sl=s:gosub400:ws=sl:return
- 194 gosub212:n=.:k=tr:gosub12:t=960:ifhp<3thengosub470:poke861,.-(t2>.orq>=jm-x)
- 195 fork=1to4:h=peek(b+k):y=.:ifmbork=trthenh=peek(t+k):y=1
- 196 ifhthenifh>=fnc(k)or(peek(861)andh>=peek(839+k))thenh=fnb(k):ifythenh=peek(t-4+k)
- 197 poke849+k,.-(peek(t-4+k)>h)*(peek(t-4+k)-h)
- 198 ifk=trtheniffnb(k)theniffnv(k)thengosub631:poke864,l*fnz(u)+(1-l)*u
- 199 ifk<>trthenift2=.andpeek(861)=.theny=peek(843+k):ifh>ythenn=n+h-y:h=y
- 200 pokei+k,h:next:poke870,n:return
- 201 d=2:x=fny(op):ifde=oporde=fnz(op)thend=1:x=op
- 203 forj=dtoestep2:z=peek(i+j):ifzandz<36theniffnq(l)=fnq(z)theny=x:j=e
- 204 x=fnz(x):next:return
- 205 l=49800:pokel,k:return
- 206 dx=.:ifsx=.orsx=5thenreturn
- 207 l=sx:gosub201:ifu=ythengosub58:dx=w:return
- 208 ws=sx:gosub8500:dx=w+s:return
- 209 le=fny(pl):db=fny(le):pb=fny(db):tr=fnq(gb):return
- 210 x=.-(peek(998)=kandu=peek(997)):return
- 212 poke860,.:poke864,.:gosub18:n=t:pokev,.:pokeb,.:gosub49
- 213 forj=1to4:pokev+j,peek(n+j):pokev,peek(v)+peek(n+j):pokeb+j,peek(t+j):pokeb,peek(b)+peek(t+j):next
- 214 d=4:poke899,u:poke900,fnz(u):sys52127:gosub28:gosub374:mb=g:poke859,q
- 215 gosub28:v(.)=.:gosub374:yx=g:poke865,q:sys52545:pokev+9,peek(898):pokeb+9,peek(899):return
- 219 ifcithengosub896
- 221 gosub1700:forj=.to4:v(j)=.:next:g=.:poke51578,32:gosub775
- 222 ifpeek(c)<>99andgc=4thenifpl=2orpl=3thenu=pl:print"[147]":gosub1070:o=5:gosub30:gosub1080
- 223 sysc+20:sl=.:gosub891:gosub510:goto9000
- 225 gosub52:gosub901:print" ";
- 226 gosub250:ifsl>98then235
- 227 ifa$="@"thenprint"[157][157]";:goto3534
- 228 ifa$=chr$(43)thengosub63:print"[157]->[146] ";:gosub259:gosub5:goto245
- 230 ifa$="p"ora$="d"ora$="r"thengosub257:goto243
- 235 d=7:gosub108:ifd=.then226
- 239 h=val(a$):print"[157][144]"a$;" ";
- 240 gosub250:ifa$=chr$(20)thenprint"[157][157] [157]";:goto226
- 241 d=.:gosub254:ifd=.then240
- 242 print"[157]";:z=(h-1)*5+d:gosub26:printz$(fnq(d));
- 243 ifsl<98then3590
- 244 return
- 245 gosub901:print" ";:z=yx:goto225
- 250 geta$:ifa$=""thenprint"[157][144][191]";:gosub4:print"[157][146][191]";:gosub4:goto250
- 251 return
- 254 gosub101:ifx=.thenreturn
- 255 ifa$="n"thend=5
- 256 return
- 257 z=.-36*(a$="d")-37*(a$="r")
- 259 print"[157][144]";:gosub162:return
- 266 x=.:iftrthenif(fnx(k)andv(pl))orfnb(k)+fnv(k)=13-peek(c+k)thengosub109:ifl<13thenx=1
- 267 return
- 268 x=1:gosub34:if(yand1)=.or((uand1)>.andpeek(kx)>.)thenreturn
- 269 poke998,sl:y=u:ifuand1theny=fny(fnz(u))
- 270 x=879-(y=pb):k=sl:gosub65:return
- 271 x=peek(879-(fny(u)=pb))andfnx(k):return
- 272 x=peek(879-(fny(u)=le))andfnx(k):return
- 274 gosub15:y=peek(t)+peek(t+9):return
- 275 foru=1to4:o=4:ifu>2theno=21:ifu=3thenprint"[145][145][145][145][145][145][145][145][145][145][145][145][145]"
- 276 gosub1082:next:print:return
- 283 gosub28:gosub153:gosub28:return
- 284 print"[147] [149]e[146]nter h[146]and ";
- 285 print" [ *=suit f1=menu ]":return
- 290 print""tab(14):gosub907:ifb%thengosub292:return
- 291 foru=1to4:gosub981:gosub95:gosub956:next:return
- 292 foru=1to4:gosub30:gosub981:gosub95:gosub39:gosub956:next:return
- 294 gosub146:gosub5:gosub2:return
- 299 h=int(h/2)+1:return
- 300 gosub24:print"[147] contract[146] ";:z=gb:gosub162:gosub60:print"[149]";
- 301 print" declarer[146] ";:u=pl:gosub92:gosub307:return
- 302 print"[144]"tab(165)peek(c+5)spc(2)peek(c+6):return
- 307 ifgcthengosub99:ifc%(5+q)thenprint"(v)";
- 308 print:return
- 313 gosub51:pokea+1,9:pokea+5,10:pokea+15,88:pokea+4,23:gosub4:gosub2:return
- 314 gosub51:m=1:d=12:gosub2102:gosub2:return
- 315 gosub99:onq+1gosub313,314:return
- 316 gosub51:pokea+5,20:pokea+6,175:pokea+4,33:pokea+1,40+rnd(1)*m:gosub4:pokea+4,32:gosub2:return
- 317 pz=.-2*(t=5or(t>8andt<12)or(t>16andt<24)):return
- 334 y=.:l=fny(u):ifv(4+l)=16andv(4+fnz(l))=16thenreturn
- 335 t%=1:x=fnx(s):if(v(4+l)andx)or(v(4+fnz(l))andx)theny=1
- 336 return
- 340 s=int((c%-1)/13)+1:return
- 341 x=.:ifz<36thenx=fnq(z):ifxthenx=fnx(x)
- 342 ifv(u+4)=16thenv(u+4)=x:return
- 343 v(u+4)=v(u+4)orx:return
- 349 pz=peek(kx)+1:ifpeek(kx)=kcthenpz=.:return
- 350 gosub361:d=k:gosub9:if(pz=.anddx=4andw=2andx>9)or(peek(863)andfnx(k))thenpz=2
- 351 ifpz=2thenifr>1andkc>2andkd>1thenifpeek(ky)=.andpeek(kx)=1andjm>2thengosub357
- 352 return
- 353 pz=.:ifq=peek(kx)then349
- 354 ifq=1thengosub540:iff=.thenreturn
- 355 ifpeek(kx)then349
- 356 pz=1:gosub361:return
- 357 gosub540:ifp=1thenpz=3:gosub513:y=c%:gosub36:ifw>2orc%<t%thenpz=2
- 358 return
- 361 gosub513:y=c%:gosub36:ifw>1thenpz=.
- 362 return
- 370 gosub340:iftr=.ortr=slorws=trors<>trthen372
- 371 t%=c%:ws=s:wt=u:return
- 372 ifs=wsthenifc%>t%thent%=c%:wt=u
- 373 return
- 374 g=.:q=.:d=.-4*(d=.)
- 375 fork=1to4:e=fnx(k):ifpeek(b+k)thenifk<>trandfnv(k)=.thenv(.)=k
- 377 iffnv(k)theniftrtheniffnb(tr)andfnb(k)=.thenq=q+e:g=fnx(tr)org
- 378 ifpeek(1000+d+k)theng=eorg
- 379 next:return
- 392 forx=yto7:gosub395:m=29-4*x:d=32-4*x:pokea+24,15:gosub2102:next:return
- 393 gosub51:y=2:gosub392:gosub2:gosub4:gosub20:return
- 394 x=3:ifpland1thenx=12+pl
- 395 poke53280,x:return
- 400 d=s:poke900+c%,.:poke976+u,d:ifhp>1andd<>slthenv(u)=fnx(sl)orv(u)
- 402 pokec+d,peek(c+d)+1:gosub2326:ifhp>1thenifu=leoru=pbthenifd<>slthengosub2325
- 405 ifuand1orb%<>2thenpokeb+d+4,peek(b+d+4)-1:gosub9:ifx>9thenpokeb+10+d,peek(b+10+d)-2^(x-10)
- 406 ifhp=4thengosub2312:poke997,fny(u)
- 407 ifhp=4andgc=2thenif1andwtthenifws=slandk=wsthengosub2085:ifwthengosub268
- 408 return
- 410 iffnb(tr)thenifpeek(864)<>uthenreturn
- 411 forj=1to4:x=x-(peek(964+j)>.andfnv(j)=1andj<>trand(peek(865)andfnx(j))=.):next:return
- 418 l=peek(843+k):z=.-((fnx(k)andv(fny(u)))>.andfnc(k)>.):h=q+35+13*(l-1)+t2*7
- 425 ifrorpeek(881)thenh=h-2*h*(peek(858)>.andpeek(864)=fnz(u))-300*(z>.orr(tr)=2)
- 426 ifqthenifrthenx=.:gosub410:h=h+5*q+x*3000
- 428 ifr=.andt2=.thenifpeek(v+9)andl=.thengosub470:ifz=.andx=.thengosub299
- 429 iflthenifprandq=.thenh=h+30*(pr-1):gosub210:ifxthenh=h*2
- 430 ift2=.andpeek(864)=.andfnv(tr)=1thengosub561:ifl=.orq=.thenh=14+q
- 433 return
- 436 x=.:ifpeek(864)=fnz(u)thenifpeek(b+tr)>=fnc(tr)orpeek(v+tr)<fnv(tr)thenx=1
- 437 return
- 438 gosub73:gosub1700
- 439 q=peek(2)and1:c%(1+q)=c%(1+q)+pc:u=pl:gosub99:b=q:k=c%(1+b):ifyxthen452
- 440 gosub776:l=c%(5+b):s=peek(c+5+b)-6-t:ifs<.then460
- 442 ifgb>25thenx=1+int(gb/31):pc=500*x+(l*250*x):k=k+pc:a$=" slam":gosub1715
- 447 ifdnthenk=50+k+((((1+c%(5+b))*100)*s)*dn):goto452
- 449 k=k+20*s:iff=.orf>2thenk=k+10*s
- 452 c%(1+b)=k:gosub110:c%(3+b)=c%(3+b)+tb:ifc%(3+b)<100then480
- 455 c%(5+b)=c%(5+b)+1:ifc%(5+b)=2thenc%(1+b)=c%(1+b)+700-(c%(6-b)*200)
- 458 goto480
- 460 j=c%(2-b):s=abs(s):ifdnthenj=j+((100*(1+l))*dn)+(((s-1)*(2+l)*100)*dn):goto463
- 462 j=j+((50*(1+l))*s)
- 463 c%(2-b)=j:goto480
- 464 c%(.)=c%(.)+1:printspc(11)" rubber [146]"c%(.)" is over [146]":c%(1)=c%(1)+c%(3)
- 465 y=19:gosub294:gosub5:c%(2)=c%(2)+c%(4):forj=3to6:c%(j)=.:next:goto492
- 470 x=.:ifpeek(835+k)=.or(fnx(k)andv(fny(u)))or(fnx(k)andv(fny(fnz(u))))thenreturn
- 471 ifpeek(843+k)orfnc(k)=2thenx=1
- 472 return
- 474 j=.:gosub470:ifq>=jm-xthenj=1:ifk=trthenh=42:ifr=.andt2=.thenh=h*2
- 475 ifjandk<>trthenifethenh=h+5*x:ift2thenifrande>=rthenh=h*2
- 476 ifjthenift2=.andk=trandpeek(kx)=qthenif(peek(858)=.and(kd=.ormb=.))thenh=400
- 477 ifrthenift2ork=trthenifdx=4thenifq>=jm-1andfx>.thenife>rand(kd=.ormb=.)thenh=310
- 479 return
- 480 print"[147]"tab(168):gosub33:print" score [146]";:gosub87
- 481 print""tab(253):u=1:forn=1to4:u=fny(u):gosub92:printspc(5-(n=2)*21):next:print:gosub2120
- 482 print" premium"tab(14)c%(1)tab(24)c%(2):print"":gosub21:print
- 483 print" game"tab(14)c%(3)tab(24)c%(4):print:gosub21:print:j=1
- 484 print" total"tab(14)c%(3)+c%(1)tab(24)c%(4)+c%(2):print"":gosub485:onjgoto490,464
- 485 ifc%(5)=2orc%(6)=2thenj=2:return
- 486 poke897,2:poke896,127+c%(5)*19+c%(6)*38:sys49936:return
- 490 gosub4:gosub4:ifc%(3+b)>=100thenfort=1to2:c%(t)=c%(t)+c%(t+2):c%(t+2)=.:next
- 492 gosub496:goto174
- 496 gosub517:sys52624:gosub20:return
- 500 gosub1150:on1+peek(i)goto74,718
- 507 poke900,k*13+1:poke899,c%:sys50427:x=peek(896):return
- 508 gosub157:gosub507:return
- 509 v=peek(b):db=peek(b+9):w=v+db:le=peek(b+10):return
- 510 pokec,peek(c)+1:r(.)=14-peek(c):return
- 513 gosub156:s=.
- 514 sys50003:s=s+1:ifs=pzthengosub152:s=.-(c%>t%):return
- 515 pokel+1,peek(l+1)+1:goto514
- 517 gosub52:gosub51:y=5:gosub392:gosub2:x=1:gosub395:return
- 518 t2=.-2*(tr=.orfnc(tr)=.):poke895,abs(fx):return
- 525 forj=1to4:ifj=psorj=prorj=mstheny=y-j:x=x+1
- 526 next:return
- 530 ifroryx=.thenifk<>trtheniffnx(k)andpeek(859)thengosub536
- 533 ifrort2or((mbandfnx(k))=.and(peek(859)andfnx(k))=.)thenreturn
- 534 iffnb(tr)=.thenifyxor(peek(861)andfnv(tr)-peek(v+tr)+peek(v)>=r(.)-fx)thenx=1
- 535 return
- 536 ifqthengosub410:gosub561:x=.-((peek(843+k)=.andx=.andt2=.andl=.)orpeek(864)=fnz(u))
- 538 ifq=.andpr<2thengosub210:x=1-x:ifx=.thenifpr=.thenx=1
- 539 return
- 540 f=.:p=.:poke893,.:x=3:ifq>1orq>=jmthenreturn
- 542 gosub1450:iffnv(k)>1thenifp>1orpeek(893)thenf=peek(893)+2*p-1
- 543 return
- 550 gosub564:ifsthenh=h*3:ifk=trthenpoke860,1:h=h*2
- 551 ifkc>2andpr=.thenifjm>2andr>1thenifdx=4ork=trthengosub556
- 552 return
- 556 x=3:gosub34:ify<>fnz(u)thenreturn
- 557 x=4:gosub34:if(yand1)=.thenx=5:gosub34:ify=fnz(u)thenh=225:x=863:gosub65
- 558 return
- 559 s=fnx(k):poke999,.-fnz(u)*(peek(871)>.and(peek(862)ands)=.and(peek(kx)<kcormb=s)):goto582
- 561 l=.-(fnc(tr)=peek(964+tr)):return
- 564 s=.:ifr=.orfx<1ordx<>4orjm<3orkd<2orkc<2ore=1orpeek(kx)<>1thenreturn
- 565 gosub540:ifpeek(893)thenifmb+(peek(858)>.)*fnx(tr)=.orp=1thens=1
- 566 return
- 570 k=sl:ifhp=4orpeek(999)=uthenifpeek(b+k)=kcthenifkdthenife=.thenifkc<=kdthen74
- 572 gosub153:ifdthen158
- 580 k=sl
- 582 gosub151:ifdthen158
- 586 gosub1350:ifk<>trorr(k)=1then582
- 590 gosub10:gosub675:ifx=3then603
- 596 ifv(fnz(fny(u)))andfnx(sl)theniffnc(sl)then601
- 599 ifpeek(881)andhp<4thenifpeek(b+k)thengosub1510:ifpeek(881)then74
- 600 ifhp<4theniffnb(k)>1thengosub610:ifx=2then605
- 601 gosub675:onxgoto582,158
- 603 r(k)=1:gosub1331:goto582
- 605 pz=2:ifpeek(kx)thenifpeek(kx)+peek(ky)>fnc(tr)or(fx=.andq>jm)then74
- 606 ifpeek(kx)thengosub349:ifpz=.thenpz=2
- 607 ifws=trthengosub513:ift%>c%then74
- 608 goto613
- 610 x=.:l=v(fny(u)):if(fnx(sl)andl)orfnc(sl)=.thenx=1:ift2=.and(landfnx(tr))=.thenx=2
- 611 return
- 613 gosub513:gosub158:return
- 615 z=.:d=.:m=b:n=v:iffnv(k)>fnb(k)thenm=v:n=b
- 617 fork=1to4:ifk=trthen619
- 618 gosub10:s=peek(m+k+4)-peek(n+k+4):gosub624:ifs>.thenifethenifjm>qthengosub621
- 619 next:k=tr:gosub10:ifdthenpoke858,d:ifd<peek(n+k+4)thenpoke858,.
- 620 poke867,.-(z>.)*z:return
- 621 ifq=1ande>1thengosub540:iffthenifp>1thene=e-p+1:ife<1orp>fnc(k)thene=1
- 622 ifq=.ande>1thenifpr>1thene=e-pr+1:ife<1orpr>fnc(k)thene=1
- 623 d=d+s+(s>e)*(s-e):return
- 624 z=z-(s>.ande>.)*s+(e=.)*abs(s):return
- 625 x=.-(t2or((peek(864)orfnb(tr)=.)andpeek(861)andfnv(tr)-peek(v+tr)+peek(v)<r(.)-fx)):return
- 626 x=.:y=peek(b+tr)+peek(v+tr)-peek(960+tr):n=peek(867):ify=.thenreturn
- 627 if(n>=yandy>=r(.)-fx-peek(960+tr))or(r>.andy>=randn>=r)thenx=1
- 628 return
- 631 l=.:f=fnb(k):iffnv(k)=<fthenf=fnv(k):l=1
- 632 return
- 638 x=db:gosub1480:j=y:x=u:gosub53:x=.-(j>y):return
- 642 gosub785:gosub507:gosub1490:ifc%<t%thenonms+1goto717,718
- 644 gosub784:ifdthenx=u:gosub53:on2+(y=c%)goto655,158
- 645 gosub638:ifxthen718
- 646 s=.:pz=p+1:gosub783:gosub514:e=c%:gosub787:gosub1460
- 647 ifdthenifms=.ore>t%thenifpz=2andy<>c%andc%>t%then158
- 648 ifms=.andw<=2thenon1+(hp=2)*(n>=mork=tr)goto717,718
- 652 if(hp=3andms=.)or(hp=2and(v(fnz(u))andfnx(k))>.)then717
- 653 goto718
- 655 iffxandq=1thengosub1150:ifpeek(i)then718
- 656 goto158
- 660 gosub266:iftr=.or(x=.and(m>.orfnv(tr)=.))thenmb=mb-(tr>.)-q*(tr=.)
- 661 ifmb>fxthenh=200:return
- 665 gosub1150:ifpeek(i)or(q=1andpeek(c+k)<2)thenh=12-m
- 666 return
- 667 gosub631:l=.-l*(peek(ky)>.andq>f):ifhp=2andl=.thenifpeek(ky)thengosub803:iffthenn=1
- 668 return
- 670 ifmthengosub689:x=c%:gosub283:ifabs(x-c%)=1orfthen580
- 671 goto613
- 675 x=1:ifws<>trthenreturn
- 676 gosub153:x=3-d:return
- 683 gosub688:gosub631:ift2=.orrthenreturn
- 684 h=h-(90-(s=.)*20)*((q>fandpeek(ky)>.)or(peek(i+k)>kcandpeek(1000+k)=.)):return
- 688 x=fnz(u):gosub1480:gosub36:s=w:gosub57:l=.-(s=w):return
- 689 y=c%:gosub36:s=w:x=fnz(u):gosub53:gosub36:f=.-(s=w):return
- 690 if(r=.andpeek(861))or(k=trandps=fxand(ps>=peek(956+k)orr-peek(870)>e))thenreturn
- 692 ifpr<2orps>=peek(956+k)or(yx=.andkd<2)then872
- 693 h=31+pr-9*(peek(ky+20)>.):ifdx<4andk<>trthenreturn
- 694 h=h*2:gosub210:y=.-(pr-1)*(pr<=e)-(e-1)*(pr>e)
- 695 ifrthenifxory>=ror(y+1>=jmande>=pr)thenift2orpeek(843+k)>1ork=trthenh=188
- 696 h=h-(k=tr):return
- 700 dx=.-(fny(u)=db):poke893,u:sys51309:ifsl=.then1250
- 701 gosub7220:ifxthen718
- 702 k=sl:gosub22:gosub3:gosub149:ifn=.then725
- 703 gosub153:ifd=.then718
- 704 ifhp<4thenif(fnx(k)andv(fny(u)))or(dxandm=.)thengosub266:goto765
- 705 onhpgoto1,706,740,760
- 706 ifdxthen642
- 708 gosub157:gosub1465:e=w:gosub786:ifpz>1thenife<2orpz>ethengosub513:on1+sgoto717,158
- 709 ifq=1then500
- 710 ifk<>trandhp=2thenif(fnx(k)andv(fnz(u)))>.orn=t2then74
- 711 ife=.orpr>1or(g=11andt=5)or(g=12andt>9)then74
- 712 ifhp=2anddx=.andk<>trthenifg>9andpeek(v+k+10)=.thenifm+2>=nthen717
- 713 ifhp=2andq=.thenifpr=.or(pr=1and(n>=mork=tr))then718
- 715 ifg<10thenift<4ort=6ort=7or(hp=3andpeek(c)=1)then74
- 716 gosub317:ifpzthengosub513:ifsthen158
- 717 gosub153:ifdthen158
- 718 k=sl:gosub508:gosub1495:ifp=fnb(k)then74
- 720 gosub151:ifdthen158
- 725 gosub1300:ifk<>trorr(k)=1then720
- 726 gosub675:on2+(hp=4orx=3)goto732,729
- 727 if(zandhp=2)or(msandhp=3)then735
- 728 gosub3:on2+(t=.orpr>1or(t<16andn<3))goto74,732
- 729 ifdxtheniffnv(tr)andfnv(sl)=.thengosub784:ifx=1or(x=2andc%>t%)thenond+1goto727,158
- 730 ifdx=.thenk=sl:gosub266:k=tr:ifxthen736
- 731 ifdx=.thenifws<>trthenk=sl:gosub266:k=tr:gosub3:ifxthenift=.orn<3then74
- 732 gosub675:onxgoto582,158
- 735 r(k)=1:gosub1331:goto720
- 736 ifhp<3andfnv(sl)<13-peek(c+sl)thengosub1460:ifwthen735
- 737 gosub3:gosub508:ifq=.thenifx=nandn>1then735
- 738 goto731
- 740 ifpeek(c)=1andtr=.thenifu=pbandn=2theniffnv(k)<3then74
- 741 ifdxorms=.then706
- 743 gosub1460:e=w:gosub1465:h=e-w:ife=.thengosub76:onq+1goto718,74
- 752 ife=1andq=1andfx>.thenif(mandn>=m)or((tr=.orm>.)andg>10andpeek(c+k)<4)then718
- 754 gosub786:ifpz>1andx<3thenifx=1or(e>1andx=2)thengosub513:ifsthen158
- 755 ifq=1then500
- 756 ifpr=1thenifn>mandk=trthen718
- 757 gosub157:gosub1465:ifw=.orh>2or(g<9and(h>.ore>1))then74
- 758 goto718
- 760 ifmsthengosub76:onq+1goto720,717
- 761 iffxanddx=.thenifq=1andn<mthengosub1460:ifw=.thenx=2:gosub1490:ifp>1then718
- 762 goto717
- 765 ifhp=2thenif(fnx(k)andv(fnz(u)))ortr=.or(dxandfnv(tr)=.)or(x=.anddx=.)then717
- 766 ifhp=3andms=.then717
- 767 ifhp=2theny=fny(fnz(u)):if(y=peek(997)andpeek(976+y)=k)or(m=.anddx=.)orz=1then717
- 768 ms=1:onhp-1goto718,760
- 775 gosub776:fx=7-t:return
- 776 t=int(gb/5)+1:f=fnq(gb):t=t+(f=.):return
- 780 x=.-(sx>.andsx<5andps<>sx):return
- 783 gosub205:pokel+1,(db-1)*13:return
- 784 gosub785:gosub787:return
- 785 gosub783:sys50003:gosub152:return
- 786 gosub508:poke896,u:p=db:gosub1455:pz=peek(893):return
- 787 poke49900,c%:gosub155:sys49903:gosub152:return
- 790 h=99:ifms=.or(zandhp<4anddx=.)thenreturn
- 791 ifhp=4ordx=.then795
- 792 iffnv(ws)thenk=ws:gosub785:k=tr:ifc%<t%then798
- 793 iffnv(ws)=.thengosub638:ifxorfnv(tr)=.thenh=1:ifx=.then798
- 794 return
- 795 ifhp<4thenifz=.thenh=1:return
- 798 gosub76:ifq=.thenh=1
- 799 return
- 800 gosub28:ps=.:ifkdthenifpeek(kx)andpeek(984+k)=1thengosub540:ps=f
- 801 ifpsthenx=871:gosub65:ifmbandk=trthenifp+1>=jmthenh=11
- 802 gosub28:return
- 803 ifror(k=trandt2=.)thengosub540:iffthengosub1110
- 804 ifrtheniff=.andq=2andjm>2thenx=4:gosub542:f=.-f*(peek(kx)=.orpeek(893)>.):iffthengosub1110
- 805 iffthenx=862:gosub65:ifk=trthenpoke860,1:h=h*2
- 806 return
- 808 iftrthenifrandk<>trthenifkdandkc<>kdthengosub920
- 809 return
- 810 gosub610:ifx<2theniffnv(ws)thens=k:k=ws:gosub283:k=s:ifdthenifpeek(v+ws)orx=1thenh=1
- 811 ifrandpeek(864)=uandh=1thengosub28:gosub436:gosub28:ifxthenifpeek(849+ws)thenh=40
- 812 iffnv(tr)andfnv(ws)=.thengosub436:ifxthenh=1
- 813 return
- 815 ifmsorpeek(999)=uthenreturn
- 816 gosub2085:ifhp=4or(t2andw=.)thenh=1:return
- 818 gosub610:gosub561:ifx=1or(w=.and(x=.or(x=2and(q<jm+1orl>.))))thenh=1:return
- 820 ifrandw=1thenifpeek(881)=.thenif(fnx(ws)andv(4+fny(u)))=.thengosub853
- 821 return
- 827 gosub52:x=.:print" [157]";:ifb%<>2thenifsltheniffnb(sl)thend=sl:goto830
- 828 gosub104:onxgoto106,120:ifa$=chr$(133)thensys53125:print"[157]";:goto827
- 829 x=.:gosub101:ifxor(b%<>2andfnb(d)=.)thenprint"[157]";:goto827
- 830 m=d:gosub56:print"[157]"z$(d)" ";:e=d:ifb%<>2thenif(gc<4oru=db)andfnb(d)=1then840
- 831 d=.:gosub104:onxgoto106,120
- 832 ifa$=chr$(20)thenprint"[157][157]";:goto827
- 833 gosub107:ifd=.then831
- 834 gosub839:ifx=.then837
- 835 gosub158:gosub55:y=d:gosub84:return
- 837 ifb%=2thenu=fnz(u):gosub839:u=fnz(u):ifxthen835
- 838 goto831
- 839 k=e:c%=13*(k-1)+d:gosub155:poke49900,c%:sys50083:x=peek(49802):return
- 840 k=e:gosub151:gosub158:y=c%-(k-1)*13:gosub84:return
- 841 poke848,sl:d=sl:gosub9:poke849,.-(x>10):return
- 847 ifpeek(858)thenifrthenifqandpeek(860)=.thengosub299:ifmbthengosub299
- 848 ifpeek(858)=.thenifpeek(1000+k)orpeek(861)thenh=h*4:ife>=randpeek(881)=.thenreturn
- 849 ifpeek(859)orpeek(858)thenif(yx=fnx(k)andpeek(865))ormb=fnx(k)thengosub859
- 851 return
- 853 if(v(fnz(fny(u)))andfnx(ws))theniffx=.ordx<4orpeek(864)=uorfnv(ws)=.thenreturn
- 854 iffnc(ws)=1thenifpeek(998)<>wsorpeek(997)<>fnz(u)thenreturn
- 855 ifpeek(980+ws)andpeek(960+ws)=.thenh=1:return
- 858 h=25+7*(dx=4)-30*(kc<=kd):return
- 859 x=peek(881):ifpeek(860)orpeek(864)=.thenreturn
- 860 ifx=.thenifpeek(861)thenifpeek(858)=.or(r=.and(peek(v+9)orpeek(v)=.))thenreturn
- 863 h=3:ifxthenifpeek(859)thenifpeek(865)orfnz(u)=peek(864)thenh=2:ift2=.thenpoke999,peek(859)
- 864 return
- 870 x=1+((fnb(tr)>.andl=.)or(l=1andfnv(tr)>.)):return
- 871 x=peek(864):x=.-((x=uandl=.)or(l=1andx=fnz(u))):return
- 872 ifprthenifkd>1andk=trthenifpeek(858)=.andpeek(kx+20)=.thenh=315:return
- 873 ifprthenifpeek(kx+20)thenifmbork=trthenreturn
- 874 iftrthengosub631:gosub870:ifx=.thenh=26-f:ifdx=4andfx>=fthenifpeek(858)thengosub871:ifxthenh=h*2
- 876 ifpeek(ky+20)andkd>1thenh=25+e:x=4:gosub1450:h=h+p*5:ifdx=4thenh=h+30
- 877 iffx>=2andps=2thenife>3thenx=3:gosub1450:h=h-16*(p>2)-30*(p>=jm)
- 879 return
- 888 gc=2:print" play north also? ";:gosub90:gosub81:ifa$="y"thenb%=2:x=.
- 889 return
- 891 gosub394:gosub300:gosub24:print" tricks ";tab(28)"[145]trick board"
- 892 print" n/s[149][168][168]e/w[144]":gosub302:return
- 894 ifcithenprinttab(10)"[151] deal number->[146]"ci;
- 895 print:return
- 896 gc=2:b%=.:gosub300:gosub148:ifpl=2orpl=4thenx=1:goto898
- 897 print" play declarer? ";:gosub90:gosub81:gc=.:x=1:ifa$="n"thengosub888
- 898 ifxthenprint" [149] show all hands? ";:gosub90:gosub81:ifa$="y"thenb%=1
- 899 return
- 901 y=tr:gosub62:poke211,(u-int(u/4)*4)*10:return
- 902 h=1-2*(peek(1000+k)>.and((peek(v)-peek(v+k)>.)or(kc>1andpeek(865)>.))):return
- 903 ifgb>10orps=.orpr=.orps=prorms=.orv>18then4555
- 904 y=10:x=.:gosub525:ifx=3theniffnb(y)>3andpeek(b+y)>3theno=y:goto66
- 905 goto4555
- 906 gosub33:gosub907:gosub87:return
- 907 print" bridgebrain [146]";:return
- 908 clr:goto9630
- 909 sys52091:goto175
- 910 x=.:gosub121:ifythenz=o:x=1
- 911 return
- 914 gosub149:ifmsthenfx=fx-1:iffx+1=.thenx=2:y=9:gosub919:y=21:gosub294:gosub142
- 915 ifms=.theniffx=13-peek(c)thenx=5:y=18:gosub919:gosub2120:gosub5:gosub142
- 916 return
- 919 j=50471:pokej+15,x:poke900,y:sysj:return
- 920 pokei,.:ps=peek(843+k):gosub631:ifpeek(956+k)=peek(960+k)orq+1<fthen927
- 921 ift2=.and(q>=ps-(hp>1))andf>qthenifpeek(881)=.then927
- 922 ifq=f-1thenifdx<4orf>=psorfx=.thenreturn
- 923 gosub870:ifxor(hp=3andq=fandl>.)orq<fthenreturn
- 924 pokei,1:h=h+9*ps:ifq=fandf=psthenifpeek(881)thengosub871:ifx=.thenh=90
- 925 iff<ps-(peek(881)>.)thengosub871:ifxthenh=h*2:x=869:gosub65
- 926 return
- 927 ifq>1andq>=pstheniffandf<psthenh=h*2
- 928 return
- 930 g=.:yx=1:gosub52:sys52298:poke52326,.:poke897,gb
- 931 gosub939:ifj=.then931
- 932 print:onjgoto908,933,934,909,9400,938,185,188,172
- 933 gosub275:goto930
- 934 gosub4:gosub73:gosub300:g=99:gosub292:print"":sys52469:poke52326,5:gosub52
- 935 gosub939:ifj<6then935
- 936 ifj>7thenonj-7goto188,172
- 937 gosub300:print"":ifj=7then185
- 938 gosub85:gosub209:goto219
- 939 gosub250:poke898,asc(a$):sys52325:j=peek(899):return
- 950 print"":forj=1to4:printtab(29);:gosub92:print" ":print:u=fny(u):next:return
- 955 y=hp*2:gosub62:poke211,35:return
- 956 y=96:gosub91:pokec-19,t+1:sys50105:return
- 960 d=.:gosub250:foru=xtoy:gosub17:d=d-u*(asc(a$)=peek(49401+t)):next:ifd=.then960
- 961 u=d:print"[157]";:gosub92:gosub4:return
- 963 x=1:y=4:goto960
- 967 x=5:y=6:gosub960:print:return
- 970 print:forj=.to4:printtab(o)" ":next:return
- 980 y=tb:gosub62:gosub970:gosub956:gosub39:return
- 981 ifu=dboru=plthenv=49700+(fnz(u)-1)*17:goto983
- 982 s=u:u=db:gosub15:v=t:u=s
- 983 t=49649:ifb%org=99thent=49657
- 984 if(u=le)thengosub988:return
- 985 ifu=dbthent=t+2:gosub988:return
- 986 ifu=pbthent=t+4:gosub988:return
- 987 t=t+6:ifb%=.andg<99thenifgc=4or(gc=2and(pland1)and(uand1))thentb=21:o=14:return
- 988 tb=peek(t):o=peek(t+1):return
- 997 sx=.-sx*(sx<5):return
- 998 x=.-((kd=2andky>3)orkd>2):return
- 999 x=.-((kd>2andky>1)orkd>3):return
- 1000 pokec,.:t=767:d=714
- 1002 forl=1to52:s=int((52-l)*rnd(x))+1:poket,peek(d+s):poked+s,peek(t-l):poket-l,peek(t):next
- 1005 sys50151:u=4:ifgc=.orpeek(c)>97then1092
- 1008 o=6:print"[147]":ifgc=2thengosub1090:print:goto1053
- 1033 gosub1070:gosub1080:u=1:gosub1070
- 1053 gosub1080:goto1092
- 1070 gosub148:print" display [146]";:gosub31:printtab(16)" hand? ":gosub496:print"[147]":return
- 1080 gosub1082:ifgc=4thengosub496:print"[147]"
- 1081 return
- 1082 gosub39:print:gosub274:pokec-11,146:gosub63:printtab(o)" ";:gosub92:print" ->[144]";y:return
- 1090 print"[147]";:ifci>.orgc=.thenprinttab(6):gosub906:return
- 1091 gosub485:print:return
- 1092 ifgc<>2andpeek(c)<>99thengosub1090:print""
- 1095 ifpeek(c)=99thengosub209:goto219
- 1099 goto2990
- 1100 x=fnz(u):gosub53:gosub38:gosub23:poke899,y:gosub37:return
- 1101 gosub920:ifpeek(881)=.thenif(fnx(k)andpeek(869))=.theniffnx(k)andpeek(862)thenpokei,.
- 1102 return
- 1110 iffnx(k)andv(fny(u))then1120
- 1115 gosub272:h=h+f*20-200*(x>.or(fnx(k)andv(fny(fnz(u))))>.):ifpeek(893)andmb=.thenh=h*2
- 1117 return
- 1120 f=.:ifp>1thenx=879-(u=db):gosub65
- 1121 return
- 1123 ifmthenifhp=2thenn=.:gosub667:iflornorpeek(ky)thenpokei,2
- 1124 on1-(peek(i)=2)goto74,2017
- 1150 pokei,.:x=2:gosub1490:iffx=.ork=trthenreturn
- 1151 j=t2-m-n:ifp>1thenifint(j/2)andp>=n+(hp>1)thenpokei,1:return
- 1155 ifp=.andhp=2thenx=3:gosub1490:ifpandm>pthenifint(j/2)>1or(m>nandp>=n-1+dx)thenpokei,1
- 1160 return
- 1248 h=9-5*(t2>9)+3*(pr=1)-5*(kx>1)+(kx=1)-(p=1andy=db)*20*dx:return
- 1250 mb=.:jm=976:kd=v(fnz(u))
- 1252 fork=1to4:gosub1254:ifhandk=trthenif(fnx(k)andkd)=.thenifn+m<>t2thengosub299
- 1253 r(k)=h:next:gosub1331:goto1280
- 1254 h=.:gosub3:ifn=.thenreturn
- 1255 ifk<>trthenif(fnx(k)andkd)orn+m=t2thenh=8-30*(pr>1)-90*(n=t2):gosub7280:return
- 1256 iftrandk<>trthengosub266:ifxthenh=3+(1-dx)*2:gosub1287:return
- 1257 iftrtheniffnv(tr)andm=.thengosub7289:h=1+2*q-50*(x>.andn=t2+1andpeek(v+10+tr)<4):return
- 1261 iftrandk<>trthenifn+m+1=t2thenifq=.orn=1thengosub7283:ifh=89thenh=79:return
- 1263 j=fnx(k):ifqor((jandv(pl))and(jandv(db)))thenh=78+2*q:gosub660:return
- 1265 gosub508:gosub1495:kx=p:x=1:gosub1490:ifpr>1thenh=40+n-20*(pr>2):return
- 1269 ifpthenx=3:gosub34:gosub1248:goto1278
- 1272 gosub1314:ifk<>trthenx=2:gosub1490:h=h-8*(t2>11)+(p=1)*(10-20*dx)-3*p
- 1276 ifk<>trandk=peek(u+jm)thenifu=peek(997)orfnz(u)=peek(997)thenh=h+20
- 1277 ifk<>trthenh=h-8*(k=peek(fnz(u)+jm))-25*((fnx(k)andv(4+fnz(u)))>.)
- 1278 ifu=pbandk=peek(848)thenif(fnx(k)andv(le))=.thenifpeek(849)ortr=.orpeek(c)=2thenh=h+30
- 1279 return
- 1280 gosub638:ifxthen582
- 1282 gosub3:if(q>.and((fx<3-(tr>.))orr(k)>49))orpr>1orq>1ort=6ort=7ort=3then1997
- 1283 gosub317:on1-(k<>trandpz=2)goto582,613
- 1287 x=1:gosub34:ifmorfnv(tr)=.thenify<>dbthenh=4-(q=.)*13
- 1288 return
- 1300 fork=1to4:gosub1303:r(k)=h:next:gosub1331:return
- 1303 h=.:gosub3:ifn=.thenreturn
- 1306 ifk=trthengosub790:return
- 1308 iftrthengosub266:ifxthengosub508:ifx<>norn>mthenh=30:return
- 1310 iftrtheniffnv(tr)andm=.thenifq<>nandpr+1<>nthenh=25:return
- 1311 ifn=t2thenh=35:return
- 1312 ifqthenh=1+n+9*(n-q):return
- 1314 ifprandt2-n>1thenh=3+n:return
- 1324 gosub508:h=n+20+(x=n)*15-9*(t2-n<3*x)+5*(x=n+1):return
- 1331 gosub142:k=1
- 1333 forj=2to4:ifr(j)>r(k)thenk=j
- 1334 next:return
- 1350 fork=1to4:gosub1353:r(k)=h:next:gosub1331:return
- 1353 h=.:iffnb(k)=.thenreturn
- 1354 gosub10:ifk<>trthen1357
- 1355 if(ms=.andws=trandtr<>sl)or(hp=2andfnv(tr)=r(.))thenh=1:return
- 1356 h=99:on1-(hp>2)gosub810,815:return
- 1357 ift2andfnc(k)=.thenh=4-(yx>.)-kc*(kd=.):return
- 1358 ifpeek(kx)=kcthenh=5+kc+(kd>.)*3-80*(peek(ky)>=jmandkd>kcandmb=.):return
- 1359 y=.-(kc<e-(q=.)):ifytheniftrtheniffnb(tr)thenifkc<=kdorkd=.thenh=51-kc:goto1375
- 1362 ifq=.thenx=peek(kx+20):ifxthenifrandkc>1andkc<=x+1thenh=4+x:return
- 1373 h=12+e+y*9:ifpeek(kx)thenh=14+2*e+(r=.ande=.)*9
- 1375 ifpeek(864)=fnz(u)thenifpeek(859)andfnx(k)thengosub299
- 1380 return
- 1450 poke896,fnz(u):p=u:gosub1455:p=p+(p>e)*(p-e):return
- 1455 gosub34:poke895,p:sys52573:p=peek(894):return
- 1460 poke898,u:poke897,db:gosub23:gosub37:return
- 1465 poke898,u:poke897,db:gosub23:poke899,c%:gosub37:return
- 1480 poke899,13*(k-1)+1:poke900,13*k+1:poke897,x:sys51760:y=peek(898):return
- 1490 poke896,.:p=db:gosub1455:return
- 1495 poke896,.:p=u:gosub1455:return
- 1500 v(.)=.:ifpeek(c)<13thenx=5-((r>.andpeek(881)=.)orfx<.):y=.:gosub919:gosub194:gosub96
- 1502 k=.:iftrthenk=tr-1
- 1504 gosub1525:ifhthengosub800:ifk=trthengosub847
- 1505 r(k)=h:sl=sl+1:on1-(sl>3)goto1504,1974
- 1510 poke881,.-(peek(kx)>.andpeek(ky)>.)*peek(881):return
- 1525 k=fny(k):gosub10:h=.:ifkc=.thenreturn
- 1526 ifk=trthengosub1510:ifkdthengosub615:ifpeek(881)=.thengosub626:poke881,x
- 1528 ift2thenifk<>trtheniffnc(k)=.andkd=.thenh=500:return
- 1530 iffnx(k)andpeek(859)thengosub418:return
- 1535 ifk=trthenift2thengosub902:return
- 1550 ifq=.thenh=3+e+2*pr:ps=peek(964+k):gosub690:goto1565
- 1560 h=16+q-(k=tr):gosub683:gosub474:gosub808:iffx>.andpeek(ky)=.thengosub550
- 1565 ift2=.thenifk<>trandpeek(843+k)=.thengosub561:ifl=.thengosub299:return
- 1570 f=peek(1000+k):iffthenh=h+5+f+9*(kd=1andyx=fnx(k)):ifpeek(kx)<kcthenf=.:gosub803
- 1590 return
- 1700 u=1:pc=.:poke2,.:a$=" honors"
- 1702 gosub15:x=peek(t+10+tr):if(trandx=31)or(tr=.andx=4)thenpc=150:poke2,u:goto1715
- 1705 iftrthenifx=15orx=23orx=27orx>28thenpc=100:poke2,u:goto1715
- 1710 u=u+1:ifu>4thenreturn
- 1712 goto1702
- 1715 print"[147]":gosub148:printtab(12)a$" points [146][144]"pc:print:gosub31:gosub2100:gosub5:return
- 1800 z=.:fork=1to4:gosub1806:r(k)=h:next:gosub1331:l=.:goto1820
- 1806 h=.:gosub3:ifn=.thenreturn
- 1807 ifgb>20thenift>15andk<>trthenift>23ort<20thenz=k
- 1809 iftrandk=trthenh=2:return
- 1810 ift>23or(t>11andt<16)ort=3ort=6ort=7thenh=6+int(t/10):return
- 1813 ifn=1andt<8thenh=9:return
- 1814 ift>7andn<3thenh=1:return
- 1815 ift>3andn<4thenh=4:return
- 1817 h=5+2*(t>15):return
- 1820 ifzthenk=z:goto74
- 1824 forn=1to4:ifv(4+fnz(u))andfnx(n)theniffnb(n)thenk=n:l=1
- 1825 next:iflortrthen1828
- 1826 k=1:forj=2to4:iffnb(j)>fnb(k)or(fnb(j)=fnb(k)andpeek(b+j+10)>peek(b+k+10))thenk=j
- 1827 next
- 1828 gosub3:ifr(k)>5orn=2or(l=1andt>7)thenpz=1:goto613
- 1860 iftr=.andn>4thengosub317:ifpz=2then613
- 1870 iftr=.andn>3thenpz=4:goto613
- 1875 goto582
- 1973 k=v(.):gosub142:goto1997
- 1974 gosub1331:gosub10:gosub688:sl=s:t%=w:x=.-(r=.andv(.)>.):ifkd=.thensl=99
- 1975 ifxthenifyx=fnx(k)andkc=1thenift2or(k=trandpeek(1000+tr))then1973
- 1976 ifxthenifyx=.thenifk<>trorkc=1thengosub625:ifxthen1973
- 1980 x=peek(999)andfnx(k):poke999,.-(x>.)*fnz(u):x=.:iftrthengosub530
- 1981 ifxorkc=1or(peek(863)andfnx(k))or(peek(v+k+10)andpeek(964+k)>1)then582
- 1982 j=peek(1000+k):ifpeek(999)=fnz(u)thenifjor(fnx(k)andpeek(859))then582
- 1986 gosub564:ifsthen582
- 1990 gosub470:ifpeek(ky+20)andq=.thengosub631:on1-(pr>=fandpr>=jmandl=.)goto582,1997
- 1991 ifjthenifq>peek(ky)andkd<=j+1andkc>kdthenifjm-x<=qandkd>1thenpoke999,fnz(u):goto582
- 1992 ifpeek(kx)andsl>1theniffnx(k)andpeek(862)thenpz=2:gosub513:y=c%:gosub36:ifw=1then1999
- 1993 ifjthengosub540:ift%=1andp=1andpeek(893)=.then582
- 1994 ifjthenif(t%=.andyxandr>.)or(t2andk=tr)then559
- 1995 ift%>1or(t%andpeek(ky)=kdandkd>.)or(q=.andpeek(kx+20)=1)then582
- 1996 gosub667:if(l=1andsl=.andpeek(kx)<fnc(k))or(t%andt%=slandkc>kd)or(q=.andsl=1)then582
- 1997 gosub157:goto158
- 1999 pz=2+(kc=2):goto613
- 2000 sys51342:gosub518:poke897,tr:sys51387:ifsl=.then1500
- 2001 gosub7220:ifxthenforx=1to1-12*(u=pl):gosub4:next:goto580
- 2002 gosub194:ifhp=2thengosub96
- 2003 k=sl:gosub10:gosub22:gosub149:ifkc=.then586
- 2005 gosub153:ifd=.then580
- 2006 ifhp<4theniffnx(k)andv(fny(u))orfnc(k)=.thenonms+1goto2090,2080
- 2007 ifhp>2then2045
- 2008 m=.:ifkdthengosub283:m=d:ifmthengosub688:if(landr>.)ors=.or(s=1andq=.)then580
- 2009 ifmthenn=.:gosub667:iflornthenon1-(peek(kx)=.andpeek(893)<pandn>.)goto580,74
- 2010 ifmthenifrandpeek(kx)=1thengosub1100:ifw=1theniftr=.orkd>1then580
- 2012 ifrthenifpeek(kx)andhp=3thengosub271:ifxthengosub349:ifpzthengosub513:ifsthen158
- 2013 x=peek(b+k+10):if(peek(kx)>.and(r=.ore=.))or(hp=2andkc=2andx>.andx<8)then74
- 2015 pokei,.:ifrtheniftrandk<>trthenifpeek(kx)thengosub1101:ifpeek(i)then1123
- 2017 ifrthenifqandq<jmandhp=2thengosub353:ifpzthengosub513:ifsthen670
- 2018 ifpeek(i)then580
- 2019 ifhp=2thenx=peek(kx):y=peek(kx+20):if(x=.and((yandy=pr)ory>1))or(xandx=q)then74
- 2026 ifrthenifpeek(kx)orpeek(863)thenifq<jmandhp=3thengosub349:ifpzthengosub513:ifsthen158
- 2027 ifhp=3thengosub2085:ifw>1thens=w:gosub57:ifw<2ors-w>.then74
- 2029 x=.-((ms>.andhp=3)or(hp=2andm=.)):ifxthenifpeek(kx)andq>=jmthen74
- 2030 onx+1goto580,570
- 2045 ifmsthenonhp-2goto2012,570
- 2047 j=.:gosub2095:ifxthenonhp-2goto74,570
- 2050 gosub2085:gosub271:ifhp=4orw=.or(r>.andw=1andx>.)then580
- 2051 ifrthenifxthenifpeek(kx)=1andq=<jmthenpz=2:gosub513:ifsthen613
- 2053 gosub272:ifxor(r=.and(t2ork<>tr))orq>=jmore=.or(fx=.andw>1)then74
- 2062 ifw=1or(w=2andg>9)thenifkdor(q=.andw=1)ork=trortr=.then580
- 2066 goto2015
- 2080 ifhp=3or(hp=2andkd=.)then570
- 2081 gosub283:ond+1goto570,580
- 2085 gosub38:gosub23:gosub37:return
- 2090 j=1:gosub2095:onx+1goto580,570
- 2095 t=.-(mb>.orpeek(b)>=r(.)-fx):x=.:if(r=.andyx=.andv(.)>.)orpeek(999)=uthenx=1
- 2096 ifr=.andkd=.andk=trtheniftthenifq>fnc(k)thenx=1
- 2097 ift2andyx=.andpeek(kx)>=fnc(k)+jthenx=1
- 2098 return
- 2100 gosub51:m=1:d=24:gosub2102:gosub2:return
- 2102 l=49247:sys50521
- 2103 forj=mtodstep4:pokea+1,peek(l+j):pokea,peek(l+j+1):pokea+8,peek(l+j+2):pokea+7,peek(l+j+3)
- 2104 gosub4:ifpeek(l+j)=50thengosub4:gosub4
- 2105 next:return
- 2107 print"":form=4to1step-1:gosub56:printz$(m);"[144]";peek(c+m);chr$(13):next:return
- 2120 gosub51:m=17:d=24:gosub2102:gosub2:return
- 2150 ifdnthen8
- 2151 ifgb>20thengosub3400:ifq>2or(gb>25andq>1.5)thenz=36
- 2152 ifgb>15thenx=fnq(gb):ifxthenif(a%<>1orpc=2)orgb>25theniffnb(x)>4thenz=36
- 2153 on1-(mb=37)goto8,118
- 2300 t=abs(4-u)*2+827:return
- 2310 forj=1to4:t=peek(49721+j)+peek(49755+j):d=t-int(t/2)+(t>.):x=t+(t>.)-d*2
- 2311 t=827+j:poket,d:poket+4,d:poket+8,x:next:poke879,.:poke880,.:poke881,.
- 2312 sys52613:poke998,.:poke999,.:return
- 2325 gosub2300:poket+sl,.:t=831-abs(u-4)*2:poket+sl,fnc(sl):return
- 2326 ifu=dboru=plthenreturn
- 2327 gosub2300:ifpeek(t+d)thenpoket+d,peek(t+d)-1
- 2328 return
- 2800 ifpb=15then2847
- 2803 ifpb=10then2846
- 2805 ifpb=6then2852
- 2806 ifpb<mb+5andw>17thenifkd>2andky>2thenz=pb+5:goto8
- 2820 ifpb<mb+5orgthen8
- 2821 ifky>2thenif(ps>2andkd>2)orkd>3thenz=pb+5:goto8
- 2823 z=15:goto8
- 2846 ifv>17thenz=15
- 2847 ifv>26thensx=.:goto5080
- 2850 goto8
- 2852 a%=2:o=.:gosub4377:z=7:ifothenz=o+5
- 2855 goto8
- 2900 ifpsthenifps<prandpb=gbtheniffnb(ps)+1<fnb(pr)theno=pr:goto66
- 2902 goto8
- 2990 y=10:gosub62:printspc(12)"[151] the auction [146]":poke900,6:gosub21:sys50017
- 3000 pc=-1:fx=.:sysc+20:forj=1to4:pokec+j,5:v(j)=.:v(j+4)=16:next:a%=.:print"";
- 3001 gosub2100:gosub21:e=.:gb=.:u=op:dn=.:tr=14:gosub901
- 3002 z=.:e=e+1:v(u)=v(u)+1:gosub20:ifu=4ande>1thentr=tr+1
- 3003 t%=.:sx=peek(c+u):gosub30:gosub509:ms=.:mb=.:ps=.:pb=.:gosub3050:ife>2thenifpbthen3007
- 3006 goto8000
- 3007 j=2:ws=.:sl=1:ifmbandmb<36thenifpthenifmb>p+5thensl=.
- 3008 j=j+2:ife>jthenifpeek(i+e-j)thenws=ws+1:goto3008
- 3009 t=.-(pb=20)-2*(mb=20)-3*(pb=25ormb=25):ontgoto5100,4350,4325
- 3010 ifpb=37ormb=37thenon1-(de=uorde=fnz(u))goto2153,8
- 3011 ifpb=36then4390
- 3012 ifmb=36then4380
- 3013 ifpb>20anda%=1then8
- 3014 ifws=.then3600
- 3015 gosub3061:onwsgoto3990,4500,6000
- 3016 x=ws-2*(int(ws/2)):onx+1goto7000,7100
- 3050 ife-2>.thenpb=peek(i+e-2):ifpb<36thenps=fnq(pb):ky=peek(b+ps+10):kd=fnb(ps)
- 3051 ife-4>.thenmb=peek(i+e-4):ifmb<36thenms=fnq(mb):kx=peek(b+ms+10):kc=fnb(ms)
- 3053 pr=.:p=.:ife-6>.thenp=peek(i+e-6):ifp<36thenpr=fnq(p)
- 3054 t2=.:ife-8>.thenx=peek(i+e-8):ifx<36thent2=fnq(x)
- 3055 gosub334:gosub113:g=.-(tb>=100):return
- 3061 ifgc=.orpb<>gborg=1thenreturn
- 3062 gosub99:if(psandkd>1)or(sx<5andps=sx)theniftb+c%(3+q)>=100theng=1:gosub517
- 3064 return
- 3080 l=fnz(u):if(sxandsx<5)orv(4+u)=16orv(4+l)=16thenreturn
- 3082 forj=1to4:x=fnx(j):if(v(4+u)andx)and(v(4+l)andx)thensx=j
- 3083 next:return
- 3400 q=.:forj=1to4:t=peek(b+j+10):q=q-(t<12andfnb(j)>1andt>7)*.5
- 3402 q=q-(t>11)-(t>19)*.5-(t>23)*.5:next:return
- 3460 o=.:ifpsthenif(ky>2andkd>2)or(ps>2andkd>3)then3474
- 3462 ifdb<3andv>20thengosub98:ifd=.then3495
- 3467 gosub7290:ifothen4168
- 3468 ifpb=5andv<14then8
- 3473 ifps=.orkd<3then3495
- 3474 gosub19:ifkd>3andr>23thensx=ps:goto5080
- 3476 ifps>2andr>19thenz=ps+15:goto8
- 3477 ifr>16thenz=ps+10:goto8
- 3478 ifr>12+(ps>2)*2andkd>2thenz=ps+5:goto8
- 3495 o=.:ifv>18theno=5
- 3496 ifv>20thenz=15:goto8
- 3497 goto66
- 3498 o=ms:ifw<19then66
- 3499 o=ms+5:ifpb=5orpb<>gbthengosub79:ifdorgb>pb+5thenx=ms:goto5095
- 3502 ifdb<3thengosub98:ifd=.then3496
- 3503 goto66
- 3520 ife<3orz>gbthen8
- 3522 ifle>.thens=1:gosub8137
- 3523 ifpc=2andz=.thenifgbthen117
- 3532 gosub7050:ifz<=gbthenz=.
- 3533 ifb%<3thenif(gcandu=4)or(gc=4andu=1)thenyx=z:poke900,6-(uand1):sys51632:goto225
- 3534 ifz<=gborz>37thenz=.
- 3535 gosub901:gosub63:print" ";:gosub26:gosub162:m=z*2+(4-x)*35:gosub316:sys51522
- 3536 pokec+u,sx:sx=5:print"[144]";:ifz>35thendn=z-35
- 3537 ifzthengosub341:ifv(u)=1thenpokec+6+u,1
- 3538 ifz>gbandz<36thengb=z:dn=.:de=u
- 3542 u=fny(u):pokei+e,z:ifzthenpc=.:goto3002
- 3546 pc=pc+1:ifpc=3thena%=.:print:print" [149] all pass [146]";:gosub894:goto930
- 3550 goto3002
- 3590 ifzthenifz<=gborz>37or(z>35andgb=.)or(z=37and(dn<>1orpb=36))or(z=36anddn)then245
- 3592 ifgbandgb=pbthenif(z=37anddn<>1)orz=36then245
- 3593 ifz<>yxthensx=peek(c+u)
- 3594 goto3535
- 3600 ife-6>.thenifp=.orp>35then8
- 3602 ifpb=15then8480
- 3606 ifpb>10or(pb<>gbandgb>10andw<11)orgthen8
- 3607 ifpb=5then3700
- 3609 ifpb<5then3800
- 3610 ife-8>.thenifpeek(i+e-8)=.then8
- 3611 ife-6>.thenifpb=p+5andmb=.then8
- 3612 ifpb=10then3616
- 3615 goto3900
- 3616 sx=.:o=.:x=peek(b+15):ifx>2thenifpeek(b+x)>1theno=x
- 3617 ifo=.andv<4then8
- 3640 ifw>9thengosub4375:ifothen66
- 3642 ifv>8theno=5
- 3644 goto66
- 3700 o=.:gosub121:ifo>2thenifw>6andv<15thenz=o+15:goto8
- 3701 ifothenifw<8thenon2+(o=1)goto8,66
- 3705 ifdbthenifo=.orw<12thengosub4377:ifw>7ando>2thenz=6:goto8
- 3706 o=.:gosub121:ifoandw>9theno=o+5:goto66
- 3720 y=.:forj=1to4:y=y+peek(b+j):next:ify<8then8
- 3721 z=10:ify>9thenz=15
- 3722 ify>15thenz=20:sx=.
- 3723 goto8
- 3800 tb=.:ifkd<3then3850
- 3811 ifps=1thenifkd<4or(peek(b+1)<4andkd=4)then3850
- 3817 gosub19:ifr<7then3850
- 3820 ifky>1orkd>3or(ps>2andky>.)thentb=ps+5
- 3821 ife<5then3823
- 3822 ifmb=.then3827
- 3823 ifr>12thenif(kd>3andps>1)orkd>4thentb=ps+10:ifr>18thensx=ps:goto5080
- 3825 goto3844
- 3827 ifps>2andr>10andkd>3thentb=ps+10-5*(r>13)
- 3844 iftb>=pb+10then7
- 3850 if(peek(i+e-1)andw<9)orw<6then7
- 3860 gosub121:ifythenz=o:ifz>gbordb>3then3871
- 3870 o=.:gosub7290:z=o:ifz=.then3886
- 3871 ifz>gbthen3892
- 3872 ifz=psthen7
- 3873 ifz=gbanddn=.thenz=36:goto8
- 3875 ifzthenifw<16-fnb(z)then3885
- 3880 z=z+5:goto3892
- 3885 ifpeek(b+15)>2andpeek(b+peek(b+15)+4)>6thenifv>6then3880
- 3886 z=5:gosub98:ifdthen7
- 3887 ifv>12thenz=10:ifdb<2andv>15thenz=15:ifv>18thenz=20:sx=.
- 3889 ifz=5orz=.then7
- 3890 goto8
- 3892 ms=fnq(z):ifw>11thenkc=fnb(ms):kx=peek(b+ms+10):gosub79:ifdthensx=ms
- 3893 ifw>18thenz=z+5
- 3894 goto8
- 3900 s=.:ifpsthenifkd>2or(kd=2andky>2)thensx=ps:gosub19
- 3902 r=w+s:gosub3400:ifq=.orr<7or(q<1andr<8)thenz=10:sx=5:goto8
- 3905 ifpsthenifkd>2andr>9then5090
- 3906 ifpsthenifkd>2or(kd>1andky>2)then5092
- 3907 ifdb<2andr<10thenz=15:goto8
- 3912 forj=1to4:ifj<>pstheniffnb(j)>3andpeek(b+j)>2thenz=j+5:ifj<psthenz=j+10
- 3913 next:ifz>gbthen3918
- 3916 z=10:goto8
- 3918 ifr>9thenz=z+5
- 3919 goto8
- 3990 hp=1:if(mb=1andpeek(b+5)<4and(pb=5orpb=6))or(pb<>gbandgb>9andw<16)then8
- 3994 ifmb=5then2800
- 3999 ifmb>5andpb<mb+5thenon2+(pb=10)goto4600,4604
- 4000 ifmb>5thenifgthenifps=msor(mb>9andpb>25)then8
- 4002 ifpb=mb+10then7500
- 4004 ifpb>mb+5then5000
- 4005 ifgthen8
- 4010 gosub79:ifdthen3498
- 4012 gosub7204:ifdthen3498
- 4026 ifpb<6then3460
- 4100 tb=.:h=.-(ps>2):ifkd<3or(kd=3andky<2)then4120
- 4117 gosub19:ifr>14-hthentb=ps+10:ifhthenifr>18thenz=ps+15:goto8
- 4120 o=.:ifhandw<16then7
- 4167 gosub7290:ifo=.then4170
- 4168 gosub67:ifz>gbthen3893
- 4169 ifzandw>16thenz=z+5:goto3893
- 4170 z=.
- 4180 ifz<gbthenz=10:ifv>17thenz=15
- 4190 goto7
- 4196 o=ms:ifv>15anddb<1theno=.:ifv>18theno=5
- 4198 ifms>2thenifkc>5andw>21thensx=ms:goto5080
- 4199 goto66
- 4320 forj=1to4:t=peek(b+j+10):ift>23or(t<16andt>7)thenk=k+1
- 4324 next:return
- 4325 k=.:gosub4320:ifpb=25thenz=26-(k<4)*k:goto8
- 4326 if(k=.andpb=26)or(k+pb-26=4)thenz=30+sx-(sx=.)*5:goto8
- 4328 goto4363
- 4350 if(le=.andpb=21)or(pb-21+le=4)thenk=.:gosub4320:z=25-sx*(sx=1orsx=2ork=.):goto8
- 4361 ifsx=5orsx=.thenz=30:goto8
- 4363 gosub997:ifsxandmb=20thenx=.:gosub191:ifx+pb-21+le>3then5083
- 4364 ifsx=psthen8
- 4365 o=sx:goto66
- 4375 o=.:gosub121:ifythenreturn
- 4377 fort=3to4:ifpeek(b+4+t)>3andpeek(b+t)>2theno=t
- 4379 next:return
- 4380 gosub121:ifythenifo=<psandpb=gbthenifkd>2or(kd=1andky>3)or(pb>10andw<18)then8
- 4381 ifythens=o:gosub334:ony+1goto4396,8
- 4382 ifps=.andv>17theno=.:goto4396
- 4383 ifpsandv>17thengosub999:ifxthens=ps:gosub334:ify=.theno=ps:goto4396
- 4384 gosub98:ifdorpb=gbor(pb<>gbandfnq(gb)=.)then8
- 4385 o=.:ifv>17andgb<10theno=5
- 4386 ifv>20then5080
- 4387 goto66
- 4390 ifpeek(i+e-1)>.andv<6then8
- 4391 ifv(fnz(u))>1orw<5orgb>15or(gb>9andw<10)then8
- 4395 gosub4375:s=o:gosub334:if(o=.andw<9)or(yandw<13)then8
- 4396 ifpb<>gbthenif(fnq(gb)=o)or(gb>10andw<18)or(gb>15andw<23)then8
- 4397 goto66
- 4500 hp=2:gosub3080:ifsxandsx<5thenifpb<mb+6then6030
- 4501 ifpb<>gbthenifgb>10andw<11then8
- 4502 ifsx=.andpb<=mb+5then4550
- 4503 ifp=5andmb=6thenifpb<10then4800
- 4504 ifpb<=mb+5then4520
- 4505 ifpb=p+10orpb=mb+10then7500
- 4512 ift%andp=36thenifw<11then8
- 4514 goto5000
- 4520 gosub79:ifdthen4567
- 4521 ifps=.andpb=15thenifv<17then8
- 4522 ifpsthenon1-(ps=pr)gosub999,998:ifxthengosub19:ifr>10then4543
- 4524 if(gandw<19andps>.andkd>1)orw<9then2900
- 4525 gosub98:ifd=.then903
- 4537 ifps=.then4547
- 4538 ifpr>2thenx=fnb(pr):ifx>3or(peek(b+pr)>.and((ps=prandx>1)orx>2))thenws=pr:goto4593
- 4541 o=.:gosub7290:ifo>fnq(gb)andgb<15then66
- 4542 goto4547
- 4543 sx=ps:z=pb+5:ifr>18then5080
- 4544 on1-(r>13)goto8,5092
- 4547 ifpr>2thenif(fnb(pr)>2andpeek(b+pr)>1)or(pr>2andfnb(pr)>3)thenws=pr:goto4592
- 4548 ifmsthens=ms:gosub334:ify=.thenifkc>4andpeek(b+ms)>3then4568
- 4549 o=.:gosub7290:ifothenifw>13then66
- 4550 gosub780:ifxthen4365
- 4551 ifv>10thenif(pb=10andmb=5)or(hp=2andgb<5)then4555
- 4552 if(gb<5andw>9)orw>12thengosub98:ifdthenifv<13ord>1or(d=1andgb>10)then8
- 4553 ifw<13then8
- 4555 o=.:ifv>18then5080
- 4556 ife-6>.thenifmb=p+10andpb=mb+5thenifw<19theno=ps
- 4557 goto66
- 4567 gosub58:ifw>18andpeek(b+ms)>4then4570
- 4568 ifms>2thenifw>14andkc>6thenz=15+ms:goto8
- 4569 ifw<10then8
- 4570 ifw>18thensx=ms:goto5080
- 4577 o=ms:goto66
- 4592 ife-6>.thenifmb=p+10andpb=mb+5thenifw<19theno=ps:goto66
- 4593 gosub8500:r=w+s:ifr<10then4550
- 4594 o=pr:ifpr<>psthenifr>13theno=o+5:ifpr>2andpb>10theno=pr
- 4595 ifr>18thensx=pr:goto5080
- 4596 goto66
- 4600 gosub7204:x=.-((peek(b+15)ord)>.)*ms:goto5095
- 4604 gosub79:ifd=.thenifms<3andps>2andkd>3andky>3thensx=ps:on1-(v>21)goto5092,5080
- 4605 goto4600
- 4800 o=.:ifpb=8andpeek(b+7)<3thenifpeek(b+8)>3thenifpeek(b+4)theno=4
- 4802 ifpb>7thenifkd>3theno=ps+5
- 4803 ifo=.thengosub121:ifo=.thenifv<10andkd>2then8
- 4812 goto66
- 5000 ifps=.thenon1-(pb=20)-2*(pb=10)-3*(pb=15)goto8,5100,5203,5211
- 5002 ifps=pror(pandpr=.)thenifgandv<18then8
- 5003 ifps=prorps=msthen7500
- 5005 gosub7204:ifdthen5030
- 5008 on1-(hp=3)goto5016,5050
- 5013 ifsx=5thensx=ps
- 5014 ifv>15then5080
- 5015 o=ps:goto66
- 5016 o=.:gosub999:ifxthen5013
- 5022 gosub7290:ifv>15theno=o+5
- 5023 ifo=.thengosub121:ifo<fnq(pb)theno=.
- 5026 goto66
- 5030 gosub58:ifw>20thensx=ms:goto5080
- 5032 o=ms:goto66
- 5050 ifpsthenx=i+e-8:ifx>.thenifps=fnq(peek(x))then5060
- 5051 ifgandw<20then8
- 5052 ifkd>3andky>3then5013
- 5053 ifw>18then5080
- 5054 ifmsthenifkc>5then5030
- 5056 o=.:goto66
- 5060 ifw>18thensx=ps:goto5080
- 5061 ifgandw<20then8
- 5068 goto5014
- 5080 gosub3080:gosub997:ifgb<20then5085
- 5083 z=sx+25-(sx=.)*5:goto8
- 5085 l=fnz(u):d=.:ift%then5091
- 5086 forj=1to4:q=peek(b+j+10):ifq>15or((fnx(j)andv(4+l))>.)then5088
- 5087 iffnb(j)>1thenif(fnb(j)=2andq<12)orq<8thend=d+1
- 5088 next:ifd>1or(d=1and(sx<3orfnb(sx)<3))then5091
- 5090 z=20:goto8
- 5091 ifgtheniffnq(gb)=sxthen8
- 5092 x=sx
- 5095 z=15-(x>.)*(x-(x<3)*5):goto8
- 5100 a%=1:z=21-(le<4)*le:goto8
- 5203 ifw<19theno=.:on2+(v<6)goto8,66
- 5205 z=30-(v>17)*5:goto8
- 5208 ifv>12thenz=20:sx=.:ifv>18thenz=35
- 5209 goto8
- 5211 ifhp=2then5208
- 5214 ifmsthengosub58:ifw>20thensx=ms:goto5080
- 5216 goto8
- 6000 hp=3:h=.:gosub3080:ifpsthenifps<>prandsx=5thenh=1
- 6001 ifgandh=.thenifv<20or(pb=15andsl=.and(sx<3orsx=5))then8
- 6002 ifsxandsx<5thenifpb<mb+6then6030
- 6003 ifsx=.then6080
- 6006 ifpb>mb+5then5000
- 6012 ifpsandps=prthengosub998:ifxthengosub19:ifr>wor(ps>2andr>w-3)orr>15then6070
- 6021 gosub79:ifdthengosub58:goto6050
- 6022 gosub98:ifd=.thenifgb<15orv>18then7580
- 6023 ift2>2andt2<>mstheniffnb(t2)>4andpeek(b+t2)>3thenifw>16thenms=t2:goto6050
- 6024 ifpsthenon1-(ps=pr)gosub999,998:ifxthen6070
- 6026 ifpranda%<2theniffnb(pr)>2andpeek(b+pr)>.thenps=pr:goto6070
- 6028 ifh=.thenifpsandv<14then8
- 6029 goto7580
- 6030 gosub206:if(v>20andt%=.)or(sx>.andsx<5anddx>19-2*(peek(c+6+fnz(u))=.))thenifslthen5080
- 6031 ifps<>sxthenifpb=gbthen6034
- 6032 if(hp=2anddx<11)or(hp<>2anddx<15)orgthen8
- 6034 o=sx:if(sx>2and(hp<>2ordx>10))orsx=peek(b+15)then5092
- 6035 goto66
- 6050 o=ms:gosub79:ifdorw>20thensx=ms:goto5092
- 6052 goto66
- 6070 gosub19:o=.:ifr>13theno=ps:ifr>20thenifslthensx=ps:goto5080
- 6073 ifr>16thenifps>2andpb<13theno=ps+5
- 6075 ifo=.or(w<16andgb>10andps<2andsx=5)then6028
- 6076 goto66
- 6080 ifw<16orgthen8
- 6083 o=.:goto66
- 7000 hp=2:ifgthenifpb>mb+5orps=prthen8
- 7001 gosub3080:ifsxandsx<5thenifpb<mb+6then6030
- 7002 ifpb=5orpb=10or(ps>2andps=prandps<>msandps<>t2)then7020
- 7003 gosub780:ifxthen4365
- 7004 ife-10>.andps=prthenifpr=fnq(peek(i+e-10))and(ky>3orkd>2)theno=ps:goto66
- 7005 ifsx<5thenifg=.andw>11then4365
- 7006 ifw<14orgthen8
- 7007 ifms>2andkc>5theno=ms:goto66
- 7020 wt=.:ife-10>.thenwt=fnq(peek(i+e-10)):ifprthenifpr=wtthenx=pr:goto7022
- 7021 goto7025
- 7022 f=fnb(x):iff>2or(x>2andf>1andpeek(b+x)>1)thenws=x:gosub8500:ifw+s>10theno=pr:goto66
- 7025 gosub98:ifdthen8
- 7026 goto4555
- 7050 if(dnandz=36)or(dn=.andz=37)thenz=.:return
- 7054 ife-2>.thenifpb=gbandpeek(i+e-1)=.thenifz>35thenz=.
- 7055 ifdn=1ande>4thenifgbandgb=mbthenifz=gb+5thenz=37
- 7056 return
- 7100 hp=3:gosub3080:ifgthenifps=sxandw<24then8
- 7108 ifw>21thenifsxandsx<5then5083
- 7109 ifgb=pbandpb<>15thengosub780:ifxthen4365
- 7111 ifgthen8
- 7113 gosub997:ifgb>14thenif(sx=.andv<18)or(sxandw<18)then8
- 7115 goto4365
- 7204 d=.:ifmsandkc>4thenifkx>21or((ms>2orms=peek(b+15))andkx>9)or(kx<16andkx>11)thend=1
- 7206 return
- 7220 y=fnb(sl):x=.-((yandws=trandtr<>sl)ory=1):return
- 7280 ifqthengosub660:ifq=1andn>qthenpz=2:gosub513:gosub507:ifx>nandt2-n>1thengosub299
- 7283 iftrthenif(fnx(tr)andkd)=.thengosub109:ifl<13thengosub7289:h=89-70*x
- 7285 return
- 7289 x=.-(peek(c+tr)>8+(fnb(tr)>.)):return
- 7290 forj=1to4:if(fnx(j)andv(u+4))or(fnx(j)andv(fnz(u)+4))then7294
- 7292 if(fnb(j)>3andpeek(b+j)>3)orj=peek(b+15)orj=peek(b+16)theno=j
- 7294 next:return
- 7500 gosub3080:gosub7700:ifps=msandms<>prthen7538
- 7510 gosub7204:if(dandkd<3andms>ps)orkd=.or(kd=1andky<4)or(kd=2andky<2andle=.)then7550
- 7515 gosub19:ifgthenifw<pzor(ms=prandmb=p+10)then8
- 7520 sx=ps:ifr>=pzthenifslthen5080
- 7525 ifg=.thenifr>=pz-4or(ps>2andr>6)then5092
- 7535 goto8
- 7538 gosub58:x=.:gosub191:ifw>=pzor(w+2>=pzandx+le>2)thenifslthen5080
- 7539 ifgthen8
- 7540 goto5092
- 7550 if(gandw<pz)orw<10then8
- 7551 ifw>=pzthenifslthenifsx<>5then5080
- 7553 gosub121:ifythenifo>psorw>12thenx=ms:gosub79:on1+dgoto66,5095
- 7555 gosub98:ifdorpb<>gbandgb>14then8
- 7580 o=.:ifslthenif(sxandsx<5andw>18)or((sx=5orsx=.)andv>18andt%=.)then5080
- 7581 ifhp=3andsx=.thenifpsthenifpb=gbandgb<10theno=5
- 7582 z=.:on2+(gb>15)goto8,66
- 7700 pz=17+4*(hp=2andps=prandkd>1):ifhp=3or(hp=1andp=.andv(fnz(u))=2andps=ms)thenpz=23
- 7707 return
- 8000 wt=.:ifgbthenifde=uorde=fnz(u)thenwt=1
- 8001 ifgb=.thengosub8125:goto3520
- 8003 ifwtthenifdn=1andw>17thengosub79:ifdorgb<15thenz=37
- 8005 ifwtthen8
- 8006 ifv(u)>2or(v(u)=2andgb>15)then2150
- 8007 gosub8125:ifz=.orz>gbthen3520
- 8008 if(z<gbandv(u)=1andgb<8)orz=gbthenz=36:goto8
- 8009 ifw>17thengosub121:ifythen4396
- 8010 goto2150
- 8125 ifdbthen8130
- 8129 ifv>15then8310
- 8130 gosub3400:ifw>13or(w=13andq>1.9)then8141
- 8132 s=.:ife<3or(v>10andv(u)=1)orle=.thenreturn
- 8137 forj=5to8:ifpeek(b+j)>7-sthenz=j+6:ifj>6thengosub99:ifc%(3+q)=.thenifs=.orle>1thenz=z+5
- 8139 next:ifzthens=fnq(z):gosub334:ifythenz=.
- 8140 return
- 8141 gosub910:y=.:ifxthenx=.:iffnb(z)>5orpeek(b+z)>3then8210
- 8160 forj=1to4:if(fnb(j)>3andpeek(b+j)>3)orfnb(j)>4thenz=j:x=x+1:y=y+(2^j)
- 8170 next:ifgb=.andx>1thenz=1-3*(y=24ory=28)-2*(y=12ory=14)-1*(y=6ory=20ory=22)
- 8205 if(z=.andv>15anddb=1)or(v>21anddb<2)then8310
- 8206 z=z-(z=.)
- 8210 o=z+4:gosub182:ifw>24thenz=z+5
- 8220 return
- 8300 forj=1to4:t=fnb(j):x=peek(b+j+10):r(j)=.-((t<2andx<16)or(t=2andx<8)or(t>=3andx<6))
- 8309 next:return
- 8310 gosub8300:x=.:forj=1to4:x=x+r(j):next:ifx>1then8206
- 8312 z=5:ifv>21thenz=10:sx=.:ifv>24andx=.thenz=15
- 8316 return
- 8360 forj=1to4:ifr(j)thenif(fnx(j)and(v(4+fnz(u))orv(4+u)))=.thend=d+1
- 8365 next:ifd=.andsx=5thenifv(u)>1thensx=.
- 8366 return
- 8480 o=.:gosub121:ifothenifpeek(b+o)>2thenz=25+o
- 8482 ifo=.thenifv>9thenz=30
- 8483 goto8
- 8500 s=.:x=peek(b+ws):ifxandx<4thens=s+1
- 8501 forj=1to4:d=fnb(j):ifj<>wsthenifd<2thens=s+1:ifd=.thens=s+2
- 8502 next:iffnb(ws)<4thens=s-1
- 8503 ifpeek(b+9)=.andfnb(ws)<4thens=s-1
- 8504 return
- 9000 gosub2:sys51013:gosub2310:hp=1:de=.+(pland1):gosub290:ifb%then9005
- 9001 ifgc=.or(gc=2andde=.)thenu=pl:gosub132:gosub980:goto9005
- 9002 ifgc=2thenu=4:gosub132:gosub980
- 9005 u=le:gosub132:gosub950:gosub95:if(gcandle=4)or(gc=4andle=1)orb%=2then9008
- 9006 gosub1800:gosub83:goto9010
- 9008 gosub140:iffx=99then9066
- 9010 gosub956:gosub193:gosub841:ifb%or(gc=2andle=4)thengosub980
- 9020 hp=2:u=db:gosub132:gosub95:ifb%=.thengosub39
- 9024 ifgc=2andde=1thengosub141:goto9027
- 9025 gosub140:iffx=99then9066
- 9027 gosub956:gosub190:gosub980:hp=3:u=pb:gosub132:gosub95:gosub955
- 9030 ifb%<3thenif(gcandpb=4)or(gc=4andpb=1)orb%=2thengosub140:on1-(fx=99)goto9036,9066
- 9032 gosub700:gosub83
- 9036 gosub956:gosub190:ifb%or(gc=2andpb=4)thengosub980
- 9043 hp=4:u=pl:gosub132:gosub95:ifgc=2thenifde=1thengosub141:goto9046
- 9044 gosub140:iffx=99then9066
- 9046 gosub956:gosub190:ifb%orgc=.or(gc=2andde=.)thengosub980
- 9050 u=wt:gosub99:pokec+5+q,peek(c+5+q)+1:sl=.
- 9066 poke49665,207+peek(c):sys51111:gosub302:gosub914:ifa%thengosub2107
- 9073 gosub510:ifpeek(c)>13thengosub393:goto164
- 9100 sys52867:hp=1:u=wt:wt=.:gosub950:gosub955
- 9102 gosub132:gosub95:ifb%<3thengosub133:ifxor(b%=2andu=2)then9120
- 9104 gosub137:onx+1gosub700,2000
- 9106 gosub83:gosub9130:ifb%oru=dbthengosub980
- 9110 gosub956:u=fny(u):hp=hp+1:ifhp>4then9050
- 9115 goto9102
- 9120 gosub140:iffx=99then9066
- 9125 gosub9140:ifxthengosub980
- 9127 gosub9130:goto9110
- 9130 on1-(hp=1)gosub190,193:return
- 9140 x=.:ifb%oru=dbor(gc=.andu=pl)or(gc=2andde=1andu=4)thenx=1
- 9141 ifgc=2andde=.andu=plthenx=1
- 9142 return
- 9200 u=1:op=.:sys51705
- 9201 sys51733:poke900,u:gosub284:gosub31:l=1:k=5:sl=1:gosub9410:ifl<14then9201
- 9220 o=5:gosub39:print"y[146]es/no ";:h=u:gosub81:u=h:ifa$="n"then9201
- 9221 u=u+1:t=51744:poket,.:syst-11:poket,5:ifu<4then9201
- 9230 sys51716:print"[147]":gosub148:gosub180:goto1005
- 9300 print"[147]"tab(6);:gosub906:printtab(126)"deal number";:inputa$:ci=val(a$):ifci<=.then9300
- 9302 y=rnd(-ci):x=1:goto1000
- 9400 sl=.:k=5:gosub285:c%=.:gosub9410:ifc%=.then930
- 9401 poke898,c%:print" with ";:k=5:c%=.:gosub9410:ifc%=.then930
- 9402 poke899,c%:print:sys52509:goto175
- 9410 k=k-1:ifk<1thenk=4:ifslthenreturn
- 9412 m=k:gosub56:printtab(4)z$(k)"[144] ";
- 9414 gosub250:ifa$=chr$(133)thenprint"[157]m[146]enu":on2+(sl=.)goto9432,908
- 9416 ifa$="*"thenprint"[157][157]";:goto9410
- 9418 d=.:gosub107:ifd=.then9414
- 9420 c%=13*(k-1)+d:y=d:gosub84:ifsl=.thenreturn
- 9425 ifpeek(900+c%)<>5thenprint"[129] error[146]";:gosub5:print"[157][157][157][157][157][157][157][157][157] [145]":gosub52:goto9412
- 9430 print:poke900+c%,u:y=((u-1)*13)+l-1:poke715+y,c%:pokey+49500,c%:l=l+1:ifl<14then9412
- 9432 return
- 9630 a=54272:i=679:gosub9700:print"[147]";chr$(8):gosub20:db=.:gosub52
- 9635 deffnc(j)=peek(952+j):deffny(t)=t+1-int(t/4)*4:deffnq(t)=t-(int(t/5)*5)
- 9639 deffnz(t)=t+2-int(t/3)*4:deffnb(x)=peek(b+x+4):poke896,255:sys51810
- 9643 sys52955:deffnx(j)=2^(j-1):deffnv(j)=peek(v+j+4):op=4:gosub52:sys52826:t=peek(898)
- 9645 print"[147]":gc=.-2*(t>1)-2*(t=4):ift=3ort=5thenci=1:on2+(t=5)goto9300,9200
- 9651 gosub50:x=.:goto1000
- 9700 dimv(8),r(4),z$(7),c%(6):c=49320:pokec,.
- 9713 ford=.to7:readz$(d):next:data"nt","[216]","[218]","[211]","[193]","pass","dble","redb":return
-