poker Y!sT[!zx-Poker  David Lamb  6:6::0 amt=100d $y(2):x(2):o(9 ) #s$(4,8):z$(32 ) Ys$(1)="clubs":s$(2)="diamonds":s$(3)="hearts":s$(4)="spades" <1i=19 :o(i)=20-(i*2):i FEc(524):h(5,2):j(5):t(4):k(5) dh$(8,14) nh$(1)="Straight flush":h$(2)="Fours":h$(3)="Full-house":h$(4)="Flush":h$(5)="Straight":h$(6)="Threes":h$(7)="Two pairs":h$(8)="One pair" n=0 s=14 r=214 n=n+1 c(n)=10 *r+s r s n=1524 "m=(*524)+1 ,t=c(m) 6 c(m)=c(n) @c(n)=t Jn T n=0 U"1;"Your hand:";0: d=12 t=15  n=n+1  h(t,d)=c(n)*10 +t  temp=c(n)  4000 Ct;10 ;r$;" of ";s$(s):z=-2030:.01z# =,z:z &t 0 1 amt>9 m=(amt/10 ) 2amt<10 m=1 :d=2800  ;)2;"Bet now - Maximum stake: `";m <stake =mstake>m8,0;"Sorry - The maximum bid is `";m:1,-16:1,-16:572< ?amt=amt-stake @8,0;0;z$ DG8,0;4;"Enter numbers of cards to change";0 Nb S8,0;z$ Xb=0700 b f=1 hm=b i v=1 l 6000p vsf=08,0;2;"Invalid reply - Try again":1,-16:1,-16:590N  temp=c(n) >8,0;0;"My hand: " ;z$ d  Analyse computer hand * 2000 4 2070 >Wx(2)<6"I change none":1,-16:1,-16:2145a H%x(2)=9 t40g=t4 M%x(2)=9 gs0g=gs Rq$=q \g$=g f b=0 pt=1̱g u i=g$(t) vh(i,d)=h(i,d)*10 +q$(i) z q$(i)="0" t t=15  q$(t)"0"b=b*10 +q$(t) t  7000X Fb<10 "I change card ";b:.1}L,20:.1}L,20 Zb>10 "I change cards ";b:z=1̱b:.1}L,20+(((b)-z)*2):z  4200h  v=9  6000p Analyse hands d=12  2000  2070 d  2145a  Sort hand D f=11 t=14 #h(t,d)>h(t+1,d)3000 t f   Analyse hand D  x(d)=0 % q=0 * g=0 +i=15 ,j(i)=(h(i,d)/100d) - temp=h(i,d) .h(i,d)=(h(i,d)/10 ) /#q=q*10 +temp-h(i,d)*10 1i 4c=19 >(3000 +c*100d) Hx(d)0c=9 Rc Wg$=g Yy(d)=j(g$(g$)) \ aPrint results b v=0 c c=10 dd=12 ex(d)9 2154j ftemp=h(5,d) g 4000 h#v,c;3;r$;" High";0 i 2155k jv,c;h$(x(d)) k v=8 l c=8 md pPrint score u*16,0;z$:16,0; zQx(1)>x(2)(y(1)y(2)x(1)=x(2))2260 M"Draw - Your money returned":z=20-25-1:.05|L,z:z amt=amt+stake  2291  2230  4;"You lose ";0; .z=20-25-1:.1}L,z:z win=stake*o(x(2))  amt=amt-win amt<1:10 ,0;2;"You have NO money - Game Over":z=-2525:.02{# =,z:z:z=24-30-1:.02{# =,z:z: odds=o(x(2))  2280 4;"You win ";0 win=stake*o(x(1)) odds=o(x(1)) amt=amt+win+stake Z;1;"`";stake;" at ";odds;" to 1 = `";win;" +","`";stake;" stake = ";"`";win+stake "You are `";amt;" in credit";4:"Enter '0' for another deal";0:q:q0:10 ,9 ;"OK, game over":z=-2525:.02{# =,z:z:z=24-30-1:.02{# =,z:z:  $ 279 Swap cards f=0 temp=h(t,d) h(t,d)=h(t+1,d) h(t+1,d)=temp  Straight flush ! 3400H &x(d)=0 +x(d)=0 0 3500 Nx(d)=0 Xx(d)=1 bg=1234590 l  Fours i=12 Sj(i)=j(i+1)j(i+2)=j(i+3)j(i+1)=j(i+2)3240 i  x(d)=2 Eg=i*1000+(i+1)*100d+(i+2)*10 +i+3  Full-house 3600 x(d)=0 x(d)=0 3700t x(d)=0 +temp=3x(d)=3:g=1234590  HFlush Ii=14 Jt(i)=0 Ki L s4=0 M gs=0 Ri=15 \k(i)=h(i,d)-j(i)*10 ft(k(i))=t(k(i))+1 pi zi=14 t(i)=5x(d)=4 t(i)=4s4=i i x(d)=4g=1234590 s4=0 i=15 k(i)=s4gs=gs*10 +i i  Straight t4=0 j(1)+4=j(2)+3j(3)+2=j(4)+1j(5)=j(1)+4j(2)+3+j(3)+2x(d)=5 oj(5)=14j(1)=2j(2)=3j(3)=4j(4)=5x(d)=5 zj(1)+3=j(2)+2j(3)+1=j(4)j(2)+2=j(3)+1t4=1234 zj(2)+3=j(3)+2j(4)+1=j(5)j(3)+2=j(4)+1t4=2345) ]j(5)=14j(1)=2j(2)=3j(3)=4t4=1235 x(d)=5g=1234590  Threes i=13 1j(i)=j(i+1)j(i)=j(i+2)36408 $i . 8x(d)=6 B.g=i*100d+(i+1)*10 +i+2 L t 2 pairs ytemp=0 ~i=14 Jj(i)=j(i+1)temp=temp+1:g=g*100d+i*10 +i+1 i temp=2x(d)=7  1 pair  g=0  3700t temp=1x(d)=8  < High card Fx(d)=9 P g=5 Z  Return rank r=(temp/10 ) s=temp-r*10 r$=r r=14r$="Ace" r=13 r$="King" r=12 r$="Queen" r=11 r$="Jack"  hCompute cards to change r m=0 |i=15 q$(i)"0"m=m*10 +i i  pChange cards b$ um$=m zb$=b i=1̱b  b$(i)>"5"b$(i)<"1"f=0 i  f=0 i=1̱b  n=n+1  t=m$(i) h(t,d)=c(n)*10 +t  temp=c(n)  4000 ,((b$(i))+v),10 ;" " (((b$(i))+v),10 ;r$;" of ";s$(s) i  XSort b bb$=b lu=b vf=11 t=1̱u-1 !b$(t)>b$(t+1)7100 t f b=b$(1̱u)  Swap numbers  f=0  t$=b$(t) b$(t)=b$(t+1) b$(t+1)=t$  md <4m Qdemtakbvqg- 4uiddQ54001T4M125B145R2G45  0  %clubs diamondshearts spades # 4=\fR3eG^Tr*!H |gQz>+5?IS]q{p",6@Jo[hy4)7uStraight flushFours Full-house Flush Straight Threes Two pairs One pair