home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dark Star 2
/
Dark_Star_02_1995_-_de_Side_B.d64
/
poker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
10KB
|
252 lines
0 goto500
1 poke792,207:poke793,2:clr:restore:dim fl(52),c%(52):x=rnd(-ti)
2 poke 53280,5:poke 53281,15:print"[151]":do=1000
3 goto 11
4 print" [213][195][195][195][201]"
5 print" [221][166][166][166][221]"
6 print" [221][166][166][166][221]"
7 print" [221][166][166][166][221]"
8 print" [221][166][166][166][221]"
9 print"[151] [202][195][195][195][203]"
10 goto76
11 print"[147]";spc(8);"***********************"
12 printspc(8);"* war games blackjack[146] *"
13 printspc(8);"***********************"
16 goto19
17 if h>=41 thengoto19
18 fortd=1to2000:next:print"[147]":goto 31
19 print"";:zw=zw+1:ifzw>2thengoto1000
20 print" shuffling":say"i'm shuffling.":t=149
21 fordt=1to300:printchr$(t);" shuffling":ift>155thent=149
22 t=t+1:nextdt:h=1
23 for xy=0to52
24 fl(xy)=0:c%(xy)=0
25 next xy
26 rem
27 for i=1to52
28 d%=52*rnd(ti)+1
29 if fl(d%)<>0 goto 28
30 c%(i)=d%:fl(d%)=1:nexti
31 print"[151][147]":db$=""
32 do$=str$(do):ifdo=0thenprint" sorry broke!!":say"sorry your broke.":do=1000:goto19
33 print" bank ";:say"the bank is.":printtab(8);"";do;"[151]";
34 gosub300:print" your bet* ";:say"your bet?"
35 di$="":getdi$:ifdi$=""then35
36 ifasc(di$)>47andasc(di$)<58thenprintdi$;:db$=db$+di$:goto35
37 ifasc(di$)=13thendb=val(db$):goto42
38 ifasc(di$)=133thendo=1000:goto31
39 ifasc(di$)=134anddo<24001thendo=do+1000:goto31
40 ifasc(di$)=135then31
41 goto35
42 ifdo<dbordb<1then32
43 cs(1)=0:cs(2)=0:cs(4)=0:cs(5)=0:cs(3)=0:cs(6)=0:ch=0:cd=0
44 goto 71
45 aa=c%(h):h=h+1:bb=aa:goto 4
46 aa=bb:j=4
47 a=o:gosub 101
48 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
49 goto54
50 aa=c%(h):h=h+1:j=4
51 a=6:gosub 101
52 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
53 goto 80
54 goto 191
55 aa=c%(h):h=h+1:j=4
56 a=12:gosub 101
57 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
58 goto191
59 aa=c%(h):h=h+1:j=4
60 a=18:gosub 101
61 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
62 goto191
63 aa=c%(h):h=h+1:j=4
64 a=24:gosub 101
65 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
66 goto191
67 aa=c%(h):h=h+1:j=4
68 a=30:gosub 101
69 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
70 goto 197
71 rem
72 aa=c%(h):h=h+1:j=1
73 a=400:gosub 101
74 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
75 goto 45
76 aa=c%(h):h=h+1:j=1
77 a=406:gosub 101
78 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
79 goto 50
80 goto166
81 aa=c%(h):h=h+1:j=1
82 a=412:gosub 101
83 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
84 if cs(2)>21then208
85 goto183
86 aa=c%(h):h=h+1:j=1
87 a=418:gosub 101
88 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
89 if cs(2)>21then208
90 goto183
91 aa=c%(h):h=h+1:j=1
92 a=424:gosub 101
93 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
94 if cs(2)>21then208
95 goto183
96 aa=c%(h):h=h+1:j=1
97 a=430:gosub 101
98 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
99 if cs(2)>21then208
100 goto 46
101 if aa=1 then cc=1:e=1:ee=32:c=32:dd=83:ff=2:ct(j)=11:ct(j+1)=1
102 if aa=2 then cc=50:e=50:ee=32:c=32:dd=83:ff=2:ct(j)=2:ct(j+1)=2
103 if aa=3 then cc=51:e=51:ee=32:c=32:dd=83:ff=2:ct(j)=3:ct(j+1)=3
104 if aa=4 then cc=52:e=52:ee=32:c=32:dd=83:ff=2:ct(j)=4:ct(j+1)=4
105 if aa=5 then cc=53:e=53:ee=32:c=32:dd=83:ff=2:ct(j)=5:ct(j+1)=5
106 if aa=6 then cc=54:e=54:ee=32:c=32:dd=83:ff=2:ct(j)=6:ct(j+1)=6
107 if aa=7 then cc=55:e=55:ee=32:c=32:dd=83:ff=2:ct(j)=7:ct(j+1)=7
108 if aa=8 then cc=56:e=56:ee=32:c=32:dd=83:ff=2:ct(j)=8:ct(j+1)=8
109 if aa=9 then cc=57:e=57:ee=32:c=32:dd=83:ff=2:ct(j)=9:ct(j+1)=9
110 if aa=10 then cc=49:e=48:ee=48:c=49:dd=83:ff=2:ct(j)=10:ct(j+1)=10
111 if aa=11 then cc=10:e=10:ee=32:c=32:dd=83:ff=2:ct(j)=10:ct(j+1)=10
112 if aa=12 then cc=17:e=17:ee=32:c=32:dd=83:ff=2:ct(j)=10:ct(j+1)=10
113 if aa=13 then cc=11:e=11:ee=32:c=32:dd=83:ff=2:ct(j)=10:ct(j+1)=10
114 if aa=14 then cc=1:e=1:ee=32:c=32:dd=90:ff=2:ct(j)=11:ct(j+1)=1
115 if aa=15 then cc=50:e=50:ee=32:c=32:dd=90:ff=2:ct(j)=2:ct(j+1)=2
116 if aa=16 then cc=51:e=51:ee=32:c=32:dd=90:ff=2:ct(j)=3:ct(j+1)=3
117 if aa=17 then cc=52:e=52:ee=32:c=32:dd=90:ff=2:ct(j)=4:ct(j+1)=4
118 if aa=18 then cc=53:e=53:ee=32:c=32:dd=90:ff=2:ct(j)=5:ct(j+1)=5
119 if aa=19 then cc=54:e=54:ee=32:c=32:dd=90:ff=2:ct(j)=6:ct(j+1)=6
120 if aa=20 then cc=55:e=55:ee=32:c=32:dd=90:ff=2:ct(j)=7:ct(j+1)=7
121 if aa=21 then cc=56:e=56:ee=32:c=32:dd=90:ff=2:ct(j)=8:ct(j+1)=8
122 if aa=22 then cc=57:e=57:ee=32:c=32:dd=90:ff=2:ct(j)=9:ct(j+1)=9
123 if aa=23 then cc=49:e=48:ee=48:c=49:dd=90:ff=2:ct(j)=10:ct(j+1)=10
124 if aa=24 then cc=10:e=10:ee=32:c=32:dd=90:ff=2:ct(j)=10:ct(j+1)=10
125 if aa=25 then cc=17:e=17:ee=32:c=32:dd=90:ff=2:ct(j)=10:ct(j+1)=10
126 if aa=26 then cc=11:e=11:ee=32:c=32:dd=90:ff=2:ct(j)=10:ct(j+1)=10
127 if aa=27 then cc=1:e=1:ee=32:c=32:dd=65:ff=0:ct(j)=11:ct(j+1)=1
128 if aa=28 then cc=50:e=50:ee=32:c=32:dd=65:ff=0:ct(j)=2:ct(j+1)=2
129 if aa=29 then cc=51:e=51:ee=32:c=32:dd=65:ff=0:ct(j)=3:ct(j+1)=3
130 if aa=30 then cc=52:e=52:ee=32:c=32:dd=65:ff=0:ct(j)=4:ct(j+1)=4
131 if aa=31 then cc=53:e=53:ee=32:c=32:dd=65:ff=0:ct(j)=5:ct(j+1)=5
132 if aa=32 then cc=54:e=54:ee=32:c=32:dd=65:ff=0:ct(j)=6:ct(j+1)=6
133 if aa=33 then cc=55:e=55:ee=32:c=32:dd=65:ff=0:ct(j)=7:ct(j+1)=7
134 if aa=34 then cc=56:e=56:ee=32:c=32:dd=65:ff=0:ct(j)=8:ct(j+1)=8
135 if aa=35 then cc=57:e=57:ee=32:c=32:dd=65:ff=0:ct(j)=9:ct(j+1)=9
136 if aa=36 then cc=49:e=48:ee=48:c=49:dd=65:ff=0:ct(j)=10:ct(j+1)=10
137 if aa=37 then cc=10:e=10:ee=32:c=32:dd=65:ff=0:ct(j)=10:ct(j+1)=10
138 if aa=38 then cc=17:e=17:ee=32:c=32:dd=65:ff=0:ct(j)=10:ct(j+1)=10
139 if aa=39 then cc=11:e=11:ee=32:c=32:dd=65:ff=0:ct(j)=10:ct(j+1)=10
140 if aa=40 then cc=1:e=1:ee=32:c=32:dd=88:ff=0:ct(j)=11:ct(j+1)=1
141 if aa=41 then cc=50:e=50:ee=32:c=32:dd=88:ff=0:ct(j)=2:ct(j+1)=2
142 if aa=42 then cc=51:e=51:ee=32:c=32:dd=88:ff=0:ct(j)=3:ct(j+1)=3
143 if aa=43 then cc=52:e=52:ee=32:c=32:dd=88:ff=0:ct(j)=4:ct(j+1)=4
144 if aa=44 then cc=53:e=53:ee=32:c=32:dd=88:ff=0:ct(j)=5:ct(j+1)=5
145 if aa=45 then cc=54:e=54:ee=32:c=32:dd=88:ff=0:ct(j)=6:ct(j+1)=6
146 if aa=46 then cc=55:e=55:ee=32:c=32:dd=88:ff=0:ct(j)=7:ct(j+1)=7
147 if aa=47 then cc=56:e=56:ee=32:c=32:dd=88:ff=0:ct(j)=8:ct(j+1)=8
148 if aa=48 then cc=57:e=57:ee=32:c=32:dd=88:ff=0:ct(j)=9:ct(j+1)=9
149 if aa=49 then cc=49:e=48:ee=48:c=49:dd=88:ff=0:ct(j)=10:ct(j+1)=10
150 if aa=50 then cc=10:e=10:ee=32:c=32:dd=88:ff=0:ct(j)=10:ct(j+1)=10
151 if aa=51 then cc=17:e=17:ee=32:c=32:dd=88:ff=0:ct(j)=10:ct(j+1)=10
152 if aa=52 then cc=11:e=11:ee=32:c=32:dd=88:ff=0:ct(j)=10:ct(j+1)=10
153 restore
154 for v=1106to1306step40
155 for n=0to4
156 read q:poke a+v+n,q:poke a+v+n+54272,ff:next n
157 next v
158 restore
159 poke a+1147,cc:poke a+55419,ff:poke a+1148,ee:poke a+55420,ff
160 poke a+1187,dd:poke a+55459,ff:poke a+1269,e:pokea+55541,ff
161 poke a+1268,c:poke a+55540,ff:poke a+1229,dd:poke a+55501,ff
162 return
163 data 85,67,67,67,73,66,32,32,32,66
164 data 66,32,32,32,66,66,32,32,32,66
165 data 66,32,32,32,66,74,67,67,67,75,10001
166 ifct(4)=11anddo>=1.5*dbthen211
167 goto223
168 print" "
169 print" h[146]it";:say"hit?"
170 ifdo<2*dbthen172
171 ifcs(1)>8andcs(1)<12thenprint", s[146]tand or d[146]ouble ";:say"stand or double?":goto173
172 print" or s[146]tand ";:say"or stand?"
173 c$="":getc$:ifc$=""then173
174 if c$="s"thenprintc$:goto182
175 if c$="h"thenprintc$:goto81
176 if c$="d"thenprintc$:goto178
177 goto 173
178 db=2*db:print" "
179 print"[145] bet now ";:say"bet now.":printtab(11);db;
180 aa=c%(h):h=h+1:a=412:j=1:gosub101
181 cs(j)=cs(j)+ct(j):cs(j+1)=cs(j+1)+ct(j+1)
182 goto46
183 print" "
184 print"[145] h[146]it or s[146]tand ";:say"hit. or stand?"
185 c$="":getc$:ifc$=""then185
186 ifc$="h"orc$="s"thenprintc$
187 if c$="h"thench=ch+1:onchgoto86,91,96
188 if c$="s"then 46
189 goto 183
190 cd=cd+1:oncdgoto55,59,63,67
191 print" "
192 if cs(j)=17andcs(j+1)<17thenww$="[145] dealer takes a hit":printww$:sayww$:goto190
193 if cs(j)<17thenww$="[145] dealer takes a hit":printww$:sayww$:goto190
194 if cs(j)>21andcs(j+1)<17thenww$="[145] dealer takes a hit":printww$:sayww$:goto190
195 ifcs(j)>16andcs(j)<22thenww$="[145] dealer stands":printww$:sayww$:goto197
196 ifcs(j+1)<22andcs(j+1)>16thenww$="[145] dealer stands":printww$:sayww$:goto197
197 gosub300:if cs(1)<22thencs(3)=cs(1):goto199
198 cs(3)=cs(2)
199 ifcs(5)>21thenprint" dealer busted! you win":do=do+db:db=0:say"owel."
200 ifcs(5)>21then210
201 if cs(4)<22thencs(6)=cs(4):goto203
202 cs(6)=cs(5)
203 say"totals.me.":print" dealer";cs(6);:gosub300:printtab(13);" you";cs(3);
204 say"you.":if cs(3)=cs(6)thenprint" we push":say"we push.":db=0:goto210
205 ifcs(6)>cs(3)andcs(6)<22thenprint" you lose":say"you loose.":do=do-db:db=0:goto210
206 print" you win":say"you win.":do=do+db:db=0
207 goto 210
208 print" you busted!!":say"you busted.":do=do-db:db=0:goto210
209 aa=bb:a=0:gosub101
210 goto17
211 print" insurance y[146] or n[146] ";:say"insurence yes or no."
212 in$="":getin$:ifin$=""then212
213 ifin$="y"thenprintin$:goto216
214 ifin$="n"thenprintin$:goto223
215 goto212
216 ifbb=10orbb=11orbb=12orbb=13orbb=23orbb=24orbb=25orbb=26then220
217 ifbb=36orbb=37orbb=38orbb=39orbb=49orbb=50orbb=51orbb=52then220
218 print" ":do=do-db/2
219 print" no blackjack!":say"no blackjack.":goto223
220 ifct(1)=21thenprint" ":do=do+db/2
221 ifct(1)=21thenprint" we push!!":say"we push.":goto209
222 print" blackjack!!":say"blackjack!":goto209
223 ifcs(1)=21thencs(3)=21
224 ifcs(4)=10orcs(4)=11then228
225 ifcs(3)=21thenprint" your blackjack!":do=do+db*1.5:say"yourblackjack"
226 ifcs(3)=21then210
227 goto168
228 ifcs(4)=10then232
229 ifbb=10orbb=11orbb=12orbb=13orbb=23orbb=24orbb=25orbb=26then234
230 ifbb=36orbb=37orbb=38orbb=39orbb=49orbb=50orbb=51orbb=52then234
231 goto225
232 ifbb=1orbb=14orbb=27orbb=40then234
233 goto225
234 ifcs(3)=21thenprint" we push!!":say"we push.":goto209
235 print" dealer blackjack!!":say"dealer blackjack.":do=do-db:goto209
300 forww=1to1000:next:return
500 ifpeek(49153)=187then550
510 poke53280,6:poke53281,6:print"[147]";tab(8);" loading sub programs [146]"
520 load"sam",8,1
550 poke52,125:poke54,125:poke56,125:sys38144:]re:]sp 68:]pi 68:]li 1
555 poke720,8:poke739,49:poke744,48:poke749,48:poke754,48:poke758,169
560 poke743,169:]kn 150,150:print"[147]":goto1
1000 poke53280,6:poke53281,6
1001 poke792,207:poke793,2:print"[147] do you want to return to war games":x$=""
1002 print" or play more poker or quit ? (w/p/q)"
1003 say"do you want to return to war games or play more poker ..sucker."
1005 getx$:ifx$=""then1005
1010 ifx$="q"thenprint"[147] bye bye":say"bye bye.":end
1015 ifx$="w"then1020
1017 goto1
1020 print"[147]load";chr$(34);"war menu";chr$(34);",8,1"
1030 poke631,19:poke632,13:poke633,82:poke634,117:poke635,13:poke198,5:end