home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 3 / 003.d81 / poker (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  124 lines

  1. 1 poke53280,10:poke53281,1:gosub135:dimh$(4,10),c$(51),u(51),q(51):poke788,52
  2. 2 a=200:a$="a122334455667788990:j;q<k=":s$(1)="[218]":s$(0)="[211]"
  3. 3 s$(2)="[144][216]":s$(3)="[144][193]":fori=0to3:forj=1to26step2:c$(x)=mid$(a$,j,2)+s$(i)
  4. 4 x=x+1:next:next:gosub150
  5. 9 poke53280,7:poke53281,12:print"[147]";spc(13);"[144]ante is $";a
  6. 10 print"[159]          [197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197]"
  7. 12 print"    four of a kind         pays [214] 15"
  8. 13 print"    full house             pays [214] 10"
  9. 14 print"    flush                  pays [214] 8":print"    straight      ";
  10. 15 print"         pays [214] 6":print"    three of a kind        pays [214] 4"
  11. 16 print"    two pair               pays [214] 2":print"    pair (tens or bett";
  12. 17 print"er)  pays [214] 1.5":print"[159]          [210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][144]"
  13. 18 printspc(15);"shuffling":forj=1ton:b(j)=a:next
  14. 19 forj=0to51:u(j)=0:next:forj=0to2500:next:fori=1to4:forj=1to10
  15. 20 x=rnd(0)*51:ifu(x)=1then20
  16. 22 h$(i,j)=c$(x):u(x)=1:next:next:getx$:ifx$=""then26
  17. 23 print"[145]       depress c[146]ontinue  or  e[146]nd"
  18. 24 getx$:ifx$<>""andx$<>"c"andx$<>"e"then24
  19. 25 ifx$=""orx$="e"then125
  20. 26 forj=1ton:m(j)=m(j)-a:next:print"[147]":gosub500:gosub550:fori=1to5
  21. 27 print"";spc(i*5);:forh=1ton:gosub475:fork=1to400:next
  22. 28 print"[157][157][157][157]";:next:next:gosub200
  23. 33 gosub300:forh=1ton:print"";:
  24. 35 forj=1toh:print"";:next:print"[145][145]";spc(12);
  25. 37 fori=1to5:gosub475:print"[145][145][145][145]";:next
  26. 38 print"":print"[152]";
  27. 48 forj=1to14:q(j)=z:next
  28. 52 forj=1to5:p(j)=asc(mid$(h$(h,j),2,1))-48:q(p(j))=q(p(j))+1:next
  29. 54 b=z:c=z:d=z:forj=1to13:ifq(j)=2thend=d+1
  30. 58 ifq(j)=3thenb=1
  31. 60 ifq(j)=4thenc=1
  32. 62 next:ifc=1thenprint"4 of a kind":m(h)=m(h)+b(h)*15:goto108
  33. 64 ifb=1andd=1thenprint" full house":m(h)=m(h)+b(h)*10:goto108
  34. 66 ifb=1thenprint"3 of a kind":m(h)=m(h)+b(h)*4:goto108
  35. 68 ifd>1thenprint"  2  pair  ":m(h)=m(h)+b(h)*2:goto108
  36. 70 ifd=zthen77
  37. 72 print"  1  pair  [157][157][157][157][157][157][157][157][157][157][157]";:x=z:forj=2to9:ifq(j)=2thenx=1
  38. 74 next:ifx=zthenm(h)=m(h)+b(h)*1.5:print:goto108
  39. 76 forj=0to1200:next:print" bet taken ":goto108
  40. 77 y=z
  41. 78 s=z:lo=14:hi=z:forj=1to5:ifp(j)>hithenhi=p(j)
  42. 84 iflo>=p(j)thenlo=p(j):ifp(j)=1andy=0theny=j
  43. 86 next:iflo=1andhi=13thenp(y)=14:goto78
  44. 94 iflo+4=hithens=1
  45. 96 x=0:forj=2to5:ifmid$(h$(h,1),4,1)=mid$(h$(h,j),4,1)thenx=x+1
  46. 98 next:ifs=0andx<4thenprint" bet taken ":goto108
  47. 100 ifs=1andx<4thenprint" straight  ":m(h)=m(h)+b(h)*6:goto108
  48. 102 ifs=0andx=4thenprint"  flush    ":m(h)=m(h)+b(h)*8:goto108
  49. 104 iflo=10thenprint"royal flush":m(h)=m(h)+b(h)*25:goto108
  50. 106 print"straight fl":m(h)=m(h)+b(h)*20
  51. 108 m(h)=int(m(h)):print"[145][145] $";m(h):forj=1to1500:next
  52. 109 next:gosub555
  53. 110 b=0:forj=1ton:b=b+m(j):next:a=int((b/n)/5):ifa<1then125
  54. 112 x=.:fori=1ton:ifm(i)<aandx=0thenx=i
  55. 114 next:ifx=0then9
  56. 116 y=1:forj=1ton:ifj<>xthene$(y)=p$(j):f(y)=m(j):y=y+1:goto120
  57. 118 print"[147]";p$(j);" you're out":fork=1to2500:next
  58. 120 next:n=n-1:forj=1ton:p$(j)=e$(j):m(j)=f(j):next:ifn>0then112
  59. 125 poke53280,4:poke53281,4:print"[147]";spc(14);"game over[144]"
  60. 127 forj=1ton:printp$(j);" collects";m(j);"":next
  61. 130 poke788,49:fordl=1to3000:nextdl:goto63000
  62. 135 print"[147]                                       ";
  63. 137 forj=0to22:print"  ";:next
  64. 139 print"                                        [157][148] "
  65. 140 print"";spc(17);"[144]poker"
  66. 144 printspc(12);"by djb shibley":print"[158]";
  67. 145 print"[197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197]":return
  68. 150 print"[155]depress the number of players (1-4)"
  69. 155 getx$:ifval(x$)<1orval(x$)>4then155
  70. 160 n=val(x$):print"[147]":ifn=1thenm(1)=1000:p$(1)="player 1 ":return
  71. 165 poke53280,4:poke53281,6:forj=1ton:m(j)=1000:p$(j)="player"+str$(j)
  72. 170 print"[159]";p$(j);" return your name ";:inputp$(j):p$(j)=left$(p$(j),9)
  73. 175 iflen(p$(j))<9thenp$(j)=p$(j)+" ":goto175
  74. 176 print"":next:return
  75. 200 print"[144]raise your bet ?   (times 2, 3, or no)"
  76. 205 forh=1ton:print"";:forj=1toh:print"";:next:print"[145]";
  77. 210 print"          [145]":forj=1to20:getx$
  78. 212 ifx$="2"orx$="3"orx$="n"thenj=20
  79. 215 next:print" ";p$(h);"[145]":ifx$="2"orx$="3"orx$="n"then222
  80. 218 forj=1to45:getx$:ifx$="2"orx$="3"orx$="n"thenj=45
  81. 220 next:ifx$<>"2"andx$<>"3"andx$<>"n"then210
  82. 222 ifx$="n"then225
  83. 223 m(h)=m(h)-a*(val(x$)-1):b(h)=b(h)+a*(val(x$)-1):print"":gosub505
  84. 225 next:return
  85. 300 forh=1ton:print"[144]   ";p$(h);" press [d]raw  or  [h]old  ":print"";
  86. 305 forj=1toh:print"";:next:print"";
  87. 310 fori=1to5:d(i)=0:printspc(9+(i*5));"[144]^[157]";
  88. 315 getx$:ifx$<>"_"andx$<>"[157]"andx$<>"h"andx$<>"d"andx$<>chr$(20)then315
  89. 320 ifi=1and(x$="_"orx$="[157]"orx$=chr$(20))then315
  90. 325 ifx$="_"orx$="[157]"orx$=chr$(20)theni=i-2:goto330
  91. 327 ifx$="d"thend(i)=1:print"[144][214]";
  92. 330 print"[183][145]":next
  93. 335 forj=1to5:ifd(j)=1thenh$(h,j)=h$(h,j+5)
  94. 336 next:forj=0to9:getx$:next:next
  95. 338 print"[144]                                      ":return
  96. 475 print"";:x$=h$(h,i):print"[175][175][175][157][157][157][157][170]   [180][157][157][157][157][157][170] ";left$(x$,1);
  97. 477 ifasc(x$)=48thenprint"[157][157]1";
  98. 480 print" [180][157][157][157][157][157][170] ";right$(x$,3);" [180][157][157][157][157][183][183][183]";
  99. 485 return
  100. 500 poke53281,15:poke53280,0:print"[144]                                        ";
  101. 501 print"[156]                                        [145]"
  102. 502 forj=1to22:printspc(38);" [146][157][148] ":next
  103. 505 print"[156]           "
  104. 510 forj=1ton:print"[156]           ":print" ";p$(j);" ":print" $";
  105. 514 printm(j);"[157]";
  106. 515 iflen(str$(m(j)))<9thenfork=1to9-len(str$(m(j))):print" ";:next
  107. 525 print:print"[152] bet=";b(j);"[157]";
  108. 530 iflen(str$(b(j)))<6thenfork=1to6-len(str$(b(j))):print" ";:next
  109. 540 print:print"[156]           "
  110. 545 next:print"[156]           ":ifn<4thenforj=1to(4-n)*5:print"           ":next
  111. 546 return
  112. 550 print"[156]                                       [157][148] ":forj=0to500:next:return
  113. 555 print"[144]press any key to continue (q to quit)"
  114. 556 forj=1to90:getx$:ifx$<>""thenj=90
  115. 558 next:ifx$<>""then565
  116. 560 print"[144]                                     "
  117. 562 forj=1to40:getx$:ifx$<>""thenj=40
  118. 564 next:ifx$=""then555
  119. 565 ifx$="q"then125
  120. 566 return
  121. 63000 rem    connect back to l.s.
  122. 63002 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  123. 63004 poke198,0:poke631,13:poke632,13:poke198,2:end
  124.