home *** CD-ROM | disk | FTP | other *** search
- 1 fora=1to2:nexta
- 10 print"[147]";tab(13);"maija":printtab(13)"[196][196][196][196][196]"
- 20 i=rnd(-ti):print:print:print
- 30 print" saannot ovat maijapelin tavanomaiset":print" saannot."
- 40 print" seuraavat korvaukset luvallisia:"
- 50 print" a=[193] , s=[211] , z=[218] ja x=[216] ."
- 60 print" nosto=^ ."
- 70 print" lyonnit muodossa [211]12 jne.":print
- 400 deffnl(x)=int((x-1)/13+.0005)+1
- 410 deffnk(x)=x-13*fnl(x)+13
- 430 deffns(x)=int(80*rnd(x))-10
- 440 dimz%(5,4),l(4),ms(4),a%(52),v%(4),p%(13)
- 442 p%(0)=1:fori=1to13:p%(i)=2*p%(i-1):nexti
- 450 data"[193]","[216]","[218]","[211]"
- 500 rem sekoitus
- 510 fori=1to52
- 520 x=fns(0):ifx<1orx>52then520
- 540 ifa%(x)=0thena%(x)=i:goto570
- 550 x=x+1:ifx=53thenx=1
- 560 goto540
- 570 nexti
- 575 rem valtti
- 580 x=fns(0):ifx<1orx>52then580
- 585 ifa%(x)<14then580
- 600 rem valtti pohjalle
- 620 j=a%(x)
- 630 ifx=52then670
- 640 fori=xto51:a%(i)=a%(i+1):next
- 660 a%(52)=j
- 670 vl=fnl(a%(52)):rem valtin maa
- 680 fori=1tovl:readv$:nexti
- 690 a1=1:rem pakan jako/a1 1 vapaa kortti
- 700 print"moneksiko pelaajaksi kone jakautuu?"
- 710 print"(1-5 sallittuja) ";
- 720 gosub6000:f=asc(o$)-48:iff<1orf>5thengosub6050:goto710
- 740 printo$:print"pelaatko itse? (k=kylla) ";
- 750 gosub6000:ifo$<>"k"theno$="e"
- 760 printo$:ifo$="k"thenf=-f
- 765 a1=1:forp=(sgn(f)+1)/2toabs(f):gosub6200:nextp
- 766 p=0:gosub6100
- 770 print"kuka aloittaa? (0=sina,1-5 mina) ";
- 780 gosub6000:g=asc(o$)-48
- 790 ifg<0org>abs(f)or(g=0andf>0)thengosub6050:goto770
- 800 printo$
- 810 gosub6500
- 815 iff>0thenprint"valtti=";v$:gosub6600
- 820 ifp0<2then1000
- 830 h=g+1
- 850 ifh=abs(f)+1thenh=0
- 860 ifh=0andf>0thenh=1
- 870 ifz%(h,0)=0thenh=h+1:goto850
- 880 gosub1200:gosub6300:ifz%(g,0)=0andp0<3then1000
- 890 gosub4000:gosub6300
- 900 g=h:ifnl=1theng=h+1
- 910 ifg=abs(f)+1theng=0
- 920 ifg=0andf>0theng=1
- 930 ifz%(g,0)=0theng=g+1:goto910
- 940 goto810
- 1000 forp=0toabs(f):ifz%(p,0)=0then1050
- 1010 ifp=0thenprint"sina havisit![134]":goto1050
- 1020 print"#";mid$(str$(p),2);" havisi![134]"
- 1050 nextp:goto9800
- 1200 rem g lyo
- 1210 ml=0:ifg=0then3620
- 1220 fori=1to4:l(i)=0:ms(i)=0:nexti
- 1230 fori=1to4:forj=2to13
- 1240 ifz%(g,i)andp%(j)thenl(i)=l(i)+1:ms(i)=ms(i)+j
- 1250 nextj:ifz%(g,i)and2thenl(i)=l(i)+1:ms(i)=ms(i)+14
- 1260 nexti
- 1270 fori=1to4:ifl(i)<>0thenms(i)=ms(i)/l(i)
- 1280 nexti
- 1290 rem s-jarj
- 1300 fori=1to4
- 1310 q=90:forj=1to4
- 1320 ifms(j)<=qandms(j)>0thenr=j:q=ms(j)
- 1330 nextj:ms(r)=-1:v%(i)=r:nexti
- 1340 rem ^ v%() maat huonoin-paras
- 1350 rem maiden maara mm
- 1360 mm=0:fori=1to4:ifl(i)<>0thenmm=mm+1
- 1365 nexti
- 1370 l9=0:ml=0:z=z%(g,1):p1=4096:onmmgoto3300,2900,2230,2170
- 2170 rem 4m
- 2180 ml=1
- 2190 ifl(1)=1and(zandp1)then2212
- 2200 i1=1
- 2202 ll=v%(i1):ifll=vltheni1=i1+1:goto2202
- 2210 goto3500
- 2212 i1=1
- 2214 ll=v%(i1):ifll=1orll=vltheni1=i1+1:goto2214
- 2220 goto3500
- 2230 rem 3m
- 2235 ifa1>54-2*p0then2260
- 2240 ifl(1)>1and(zandp1)andl(vl)>0then2282
- 2242 ifl(1)>1and(zandp1)andl(vl)=0then2282
- 2244 ifl(1)>0and(notzandp1)andl(vl)>0then2282
- 2246 ifl(1)=1and(zandp1)andl(vl)>0then2300
- 2248 ifl(1)>0and(notzandp1)andl(vl)=0then2300
- 2250 ifl(1)=1and(zandp1)andl(vl)=0then2300
- 2252 goto2272
- 2260 ifl(1)>1and(zandp1)andl(vl)>0then2360
- 2262 ifl(1)>1and(zandp1)andl(vl)=0then2370
- 2264 ifl(1)>1and(notzandp1)andl(vl)>0then2272
- 2266 ifl(1)=1and(zandp1)andl(vl)>0then2360
- 2268 ifl(1)>1and(notzandp1)andl(vl)=0then2330
- 2270 ifl(1)=1and(zandp1)andl(vl)=0then2370
- 2272 rem
- 2274 i1=1
- 2276 ll=v%(i1):if(ll)=0orll=vltheni1=i1+1:goto2276
- 2280 goto3500
- 2282 rem
- 2284 ml=1:i1=1
- 2286 ll=v%(i1):if(ll)=0orll=vltheni1=i1+1:goto2286
- 2292 goto3500
- 2300 rem
- 2305 i1=1
- 2306 ll=v%(i1):if(ll)=0orll=1orll=vltheni1=i1+1:goto2306
- 2320 goto3500
- 2330 rem
- 2335 i1=1
- 2336 ll=v%(i1):if(ll)=0theni1=i1+1:goto2336
- 2350 goto3500
- 2360 rem
- 2365 ll=1:goto3500
- 2370 rem
- 2371 i1=1
- 2380 ll=v%(i1):if(ll)=0orll=1theni1=i1+1:goto2380
- 2390 goto3500
- 2900 rem 2m
- 2910 ifa1>54-2*p0then2950
- 2915 ifl(1)>1and(zandp1)andl(vl)>0then3010
- 2920 ifl(1)>0and(notzandp1)andl(vl)>0then3010
- 2925 ifl(1)=1and(zandp1)andl(vl)>0then3030
- 2930 ifl(1)>0and(notzandp1)andl(vl)=0then2330
- 2935 ifl(1)=1and(zandp1)andl(vl)=0then2370
- 2940 ifl(1)=0andl(vl)>0then2272
- 2941 goto2330
- 2950 ifl(1)>1and(zandp1)andl(vl)>0then2360
- 2955 ifl(1)>0and(notzandp1)andl(vl)>0then3030
- 2960 ifl(1)=1and(zandp1)andl(vl)>0then2360
- 2965 ifl(1)>0and(notzandp1)andl(vl)=0then2981
- 2970 ifl(1)=1and(zandp1)andl(vl)=0then2360
- 2975 ifl(1)=0andl(vl)>0then3030
- 2981 rem
- 2990 i1=4
- 2995 ll=v%(i1):if(ll)=0theni1=i1+1:goto2995
- 3005 goto3500
- 3010 rem
- 3020 ml=1:ll=1:goto3500
- 3030 rem
- 3035 ll=vl:goto3500
- 3300 rem 1m
- 3310 ifl(1)>1and(zandp1)anda1<54-p0thenml=1
- 3320 ifl(1)>0thenll=1:goto3500
- 3330 ifl(vl)>0anda1<48thenll=vl:l9=1:goto3500
- 3331 ifl(vl)>0thenll=vl:goto3500
- 3340 i1=1
- 3345 ll=v%(i1):ifl(ll)=0theni1=i1+1:goto3345
- 3370 rem
- 3500 rem koneen (g) lyomat
- 3502 l1=0:p2=0:forii=1to13
- 3504 ifz%(g,ll)andp%(ii)thenl1=l1+p%(ii):p2=p2+1
- 3506 nextii:ifl9=0then3510
- 3507 ifl1<>2thenl1=l1-(l1and2)
- 3508 forii=2to13:ifl1andp%(ii)thenl1=p%(ii):p2=1:ii=13
- 3509 nextii
- 3510 ifp2>1andll=1andml=1and(l1and4096)thenl1=l1-4096:p2=p2-1
- 3520 ifa1>40-5*p0then3556
- 3530 rem arvokortit alussa pois
- 3540 ifp2>1and(l1and2)thenl1=l1-2:p2=p2-1
- 3545 ifp2>1and(l1and8192)thenl1=l1-8192:p2=p2-1
- 3550 ifp2>1and(l1and4096)thenl1=l1-4096:p2=p2-1
- 3555 ifp2>1and(l1and2048)thenl1=l1-2048:p2=p2-1
- 3556 ifp2<=z%(h,0)then3565
- 3557 ifa1=53andmm=1andp0=2then3562
- 3558 ifl1and2thenl1=l1-2:p2=p2-1:goto3556
- 3559 i1=13
- 3560 ifnotl1andp%(i1)theni1=i1-1:goto3560
- 3561 l1=l1-p%(i1):p2=p2-1:goto3556
- 3562 i1=2
- 3563 ifnotl1andp%(i1)theni1=i1+1:goto3563
- 3564 l1=l1-p%(i1):p2=p2-1:goto3556
- 3565 z%(g,0)=z%(g,0)-p2
- 3570 z%(g,ll)=z%(g,ll)-(z%(g,ll)andl1)
- 3575 p=g:gosub6200:rem nostaa g:lle
- 3580 rem ilmoittaa koneen lyonnit
- 3581 ifh=0thenp=0:gosub6100:gosub6600:print
- 3585 print"#";g;":n lyonti:";
- 3590 restore:forii=1toll:reado$:nextii
- 3600 fori1=1to13:ifl1andp%(i1)thenprinto$;mid$(str$(i1),2);",";
- 3605 nexti1:print"[136] "
- 3610 return:rem koneelle
- 3620 rem sina lyot
- 3622 p=0:gosub6100:gosub6600:print
- 3625 print"peruutus= _"
- 3630 print"mita maata lyot ";
- 3635 gosub6000:gosub6400:printo$:ifo$="_"then3630
- 3640 ll=0:restore:fori1=1to4:reada$:ifa$=o$thenll=i1
- 3650 nexti1:ifll=0thengosub6050:goto3630
- 3660 p2=0:fori1=1to13:ifz%(g,ll)andp%(i1)thenp2=p2+1
- 3670 nexti1:ifp2=0thengosub6050:goto3630
- 3680 l1=0:goto3710
- 3690 fori1=1to13:ifl1andp%(i1)thenz%(g,0)=z%(g,0)+1:z%(g,ll)=z%(g,ll)+p%(i1)
- 3700 nexti1:goto3630
- 3710 input"montako lyot";a$
- 3711 ifa$="_"thenprint"[145]peruutat ":goto3690
- 3712 print"[145]lyot "a$" kpl. "
- 3720 a3=val(a$)
- 3730 ifa3<1ora3>p2ora3>z%(h,0)ora3<>int(a3)thengosub6050:goto3710
- 3740 fori=1toa3:print"lyontisi #";i;"=";o$;:inputa$
- 3741 ifa$="_"thenprint"[145] ":print"[145]peruutat":goto3690
- 3742 print"[145]"spc(12)" ":print"[145]"spc(13)"="o$a$
- 3750 v=0:fori1=1to13:ifmid$(str$(i1),2)=a$thenv=i1
- 3760 nexti1:ifv=0or(l1andp%(v))thengosub6050:goto3690
- 3765 ifnotz%(g,ll)andp%(val(a$))thengosub6050:goto3690
- 3770 l1=l1+p%(v):z%(g,ll)=z%(g,ll)-p%(v):z%(g,0)=z%(g,0)-1:nexti
- 3780 p=g:gosub6200
- 3800 return:rem 2:lle
- 4000 rem kaato
- 4001 nl=0
- 4010 ifg=0thenprint"sina lyot";:goto4015
- 4012 print"#";g;"lyo";
- 4015 print"...";:ifh=0thenprint"sina kaadat":goto4020
- 4017 print"#";h;"kaataa"
- 4020 ifh=0then5000
- 4030 rem kone kaataa
- 4040 a3=5*p0+20
- 4045 restore:fori=1toll:reado$:nexti
- 4050 ifll=vlanda1<a3then4600
- 4060 fori=1to13
- 4070 ifnotl1andp%(i)then4350
- 4075 if(ll=1andi=12)or(ll=vlandi=1)then4350
- 4080 ifll=vlthen4180
- 4090 forq=3to14:j=q-13*int(q/14)
- 4100 if(notl1andp%(i))or(notz%(h,ll)andp%(j))then4170
- 4110 ifll=1andj=12then4170
- 4120 ifj<>1andj<ithen4170
- 4130 if(j=1orj>10)anda1<a3andz%(h,0)<11then4170
- 4140 ifi=1then4170
- 4150 l1=l1-p%(i):z%(h,ll)=z%(h,ll)-p%(j):z%(h,0)=z%(h,0)-1
- 4160 printo$;i;"........";o$;j
- 4170 nextq
- 4180 forq=2to14:j=q-13*int(q/14)
- 4190 if(notl1andp%(i))or(notz%(h,vl)andp%(j))then4340
- 4200 i1=j:ifj=1theni1=14
- 4205 if(j=1orj>10)anda1<a3then4340
- 4210 ifrnd(0)<.95anda1<2*i1+22+.5*z%(h,0)then4340
- 4320 ifll=vlandj<iandj<>1then4340
- 4330 l1=l1-p%(i):z%(h,vl)=z%(h,vl)-p%(j):z%(h,0)=z%(h,0)-1
- 4335 printo$;i;"........";v$;j
- 4340 nextq
- 4350 nexti
- 4600 rem nostot ja kirjaus
- 4610 fori=1to13
- 4620 ifnotl1andp%(i)then4650
- 4630 z%(h,ll)=z%(h,ll)+p%(i):z%(h,0)=z%(h,0)+1:nl=1
- 4640 printo$;i;"......... ^"
- 4650 nexti:p=h:gosub6200
- 4660 return:rem 0,1
- 5000 rem #2
- 5010 print"peruutus= _"
- 5020 i2=0:fori=1to13:ifl1andp%(i)theni2=i2+1
- 5030 nexti:rem i2 lyotyjen maara
- 5040 restore:fori=1toll:reada$:nexti
- 5050 print"#";g;":n lyonti";
- 5070 print".....kaatosi"
- 5080 k1=0:k2=0:k3=0:fori=1toi2:printa$;
- 5090 i1=0:forj=1to13:ifl1andp%(j)theni1=i1+1
- 5100 ifi1=itheni1=j:j=13
- 5102 nextj
- 5110 printi1;" ";:inputo$
- 5111 o2$=mid$(o$,2):o$=left$(o$,1):gosub6400
- 5115 print"[145]"spc(14)" ":print"[145]"spc(20)o$o2$
- 5120 ifo$="_"then5050
- 5125 ifo$="^"thenk3=k3+p%(i1):goto5300
- 5140 o=0:forj=1to13:ifo2$=mid$(str$(j),2)theno=j
- 5150 nextj:ifo=0then5800
- 5160 v=0:restore:forj=1to4:reado2$:ifo2$=o$thenv=j
- 5170 nextj:ifv=0then5800
- 5180 if(v<>vland(k1andp%(o)))or(v=vland(k2andp%(o)))then5800
- 5190 if(ll=1andi1=12)or(ll=vlandi1=1)then5800
- 5195 ifnotz%(h,v)andp%(o)then5800
- 5200 ifll<>vandv<>vlthen5800
- 5205 ifll=vando=1then5280
- 5210 ifo<i1andv<>vlthen5800
- 5220 ifi1=1andv<>vlthen5800
- 5230 ifll=vlandv=vlando<i1then5800
- 5240 ifv=1ando=12then5800
- 5280 ifv<>vlthenk1=k1+p%(o)
- 5290 ifv=vlthenk2=k2+p%(o)
- 5300 nexti
- 5310 rem kirjaus
- 5320 fori=1to13
- 5330 ifk1andp%(i)thenz%(h,ll)=z%(h,ll)-p%(i):z%(h,0)=z%(h,0)-1
- 5340 ifk2andp%(i)thenz%(h,vl)=z%(h,vl)-p%(i):z%(h,0)=z%(h,0)-1
- 5350 ifk3andp%(i)thenz%(h,ll)=z%(h,ll)+p%(i):z%(h,0)=z%(h,0)+1:nl=1
- 5360 nexti:p=h:gosub6200:goto5900
- 5800 gosub6050:goto5050
- 5900 return:rem 2
- 6000 geto$:ifo$=""then6000
- 6010 return
- 6050 print"virhe[134]":return
- 6100 rem p:n kortit
- 6101 ifz%(p,0)=0thenreturn
- 6106 ifp=0thenprint"korttisi:":goto6110
- 6108 print"#";p;":n kortit:"
- 6110 print"[196][196][196][196][196][196][196][196][196][196][196]valtti=";v$
- 6115 restore:fori1=1to4:reado$:printo$;": ";
- 6120 fori2=1to13:ifz%(p,i1)andp%(i2)thenprinto$;mid$(str$(i2),2);",";
- 6130 nexti2:print"[136] ":nexti1
- 6135 print"[196][196][196][196][196][196][196][196][196][196][196]"
- 6140 return
- 6200 rem jakaa p:lle kortit
- 6215 ifa1=53thenreturn
- 6220 a2=a1+5-z%(p,0):ifa2>53thena2=53
- 6230 ifa2-1<a1thenreturn
- 6240 fori1=a1toa2-1:z%(p,0)=z%(p,0)+1
- 6250 i2=fnl(a%(i1)):z%(p,i2)=z%(p,i2)+p%(fnk(a%(i1)))
- 6260 nexti1:a1=a2
- 6270 return
- 6300 forp=(sgn(f)+1)/2toabs(f)
- 6310 ifz%(p,0)>0or(t0andp%(p))then6340
- 6315 t0=t0+p%(p)
- 6320 ifp=0thenprint"paasit pois![134]":goto6340
- 6330 print"#";mid$(str$(p),2);" paasi pois![134]"
- 6340 nextp:return
- 6400 ifo$="a"theno$="[193]"
- 6410 ifo$="s"theno$="[211]"
- 6420 ifo$="z"theno$="[218]"
- 6430 ifo$="x"theno$="[216]"
- 6450 return
- 6500 p0=0:forii=0toabs(f):ifz%(ii,0)<>0thenp0=p0+1
- 6510 nextii:return
- 6600 forp=0toabs(f):ifz%(p,0)=0then6650
- 6610 ifp=0thenprint"sinulla";:goto6630
- 6620 print"#";p;":lla";
- 6630 printz%(p,0)
- 6650 nextp
- 6660 print"pakassa";53-a1;"korttia":return
- 7000 rem vl-korjaus
- 9800 rem
- 9810 forp=0toabs(f):gosub6100:nextp
- 9900 end
-