1 2 PRINT
2 3 PRINT" BLKJAK"
3 4 PRINT
4 20 DIM W10,E10,T10,V10
5 28 PRINT"DO YOU NEED INSTRUCTIONS 1=YES 0=NO"
6 29 INPUT k
7 30 IF K=0 THEN 112
8 32 PRINT"HERE ARE THE LAS VEGAS RULES FOR PLAYING BLACKJACK:"
9 34 PRINT
10 36 PRINT">WAGER: THE HOUSE LIMIT IS $500, SO TYPE IN A NUMBER "
11 38 PRINT" FROM 0 TO 500. TO TERMINATE GAME, ENTER ZERO."
12 40 PRINT
13 42 PRINT">THE DEAL: I DEAL MYSELF 2 CARDS AND SHOW YOU ONE. THEN I"
14 44 PRINT" DEAL YOU TWO CARDS, AND ASK IF YOU WANT A HIT ANOTHER"
15 46 PRINT" CARD. YOU HAVE SEVERAL OPTIONS DEPENDING ON THE CARDS"
16 48 PRINT" YOU HOLD AND MY UP CARD:"
17 50 PRINT" * STAND - BY TYPING A ZERO"
18 52 PRINT" * TAKE A HIT - BY TYPING A ONE"
19 54 PRINT" * GO DOWN FOR DOUBLES - BY TYPING A TWO"
20 56 PRINT" * SPLIT A PAIR - BY TYPING A THREE"
21 58 PRINT
22 60 PRINT">INSURANCE: IF MY UP CARD IS AN ACE, I WILL ASK IF YOU"
23 62 PRINT" WANT INSURANCE. IF YOU DO TYPE A ONE, BETTING ONE-HALF"
24 64 PRINT" OF YOUR WAGER THAT I DO HAVE BLACKJACK. IF I DO, I PAY"
25 66 PRINT" 2-TO-1 ON YOUR INSURANCE BET. YOU LOSE YOUR ORIGINAL WAGER"
26 68 PRINT" SINCE I HAVE BLACKJACK, SO WE ARE EVEN FOR THE HAND."
27 70 PRINT" IF I DON'T HAVE BLACKJACK, YOU LOSE YOUR INSURANCE BET"
28 72 PRINT" AND THE GAME CONTINUES. "
29 74 PRINT
30 76 PRINT" IF YOU REFUSE INSURANCE BY TYPING A ZERO THE GAME"
31 78 PRINT" CONTINUES AS NORMAL."
32 80 PRINT
33 82 PRINT">THE PLAY: WHEN YOU FINALLY STAND BY TYPING A ZERO"
34 84 PRINT" I WILL DRAW CARDS UNTIL:"
35 86 PRINT" *I HAVE AT LEAST A HARD 17 HARD MEANS THE TOTAL"
36 88 PRINT" DOES NOT INCLUDE AN ACE BEING COUNTED AS 11"
37 90 PRINT" *I HAVE A SOFT 18 SOFT MEANS THE TOTAL INCLUDES AN"
38 92 PRINT" ACE COUNTED AS 11"
39 94 PRINT" *I REACH A TOTAL OF 21"
40 96 PRINT" *I EXCEED 21 AND BUST"
41 98 PRINT
42 100 PRINT">ITEMS:"
43 102 PRINT" *I PAY 1.5-TO-1 ON BLACKJACK"
44 104 PRINT" *I DON'T RECOGNIZE 5-CARDS-AND-UNDER"
45 106 PRINT" *YOU MAY DOUBLE DOWN ON A SPLIT HAND"
46 108 PRINT" *YOU DON'T LOSE ON A TIE HAND...WE PUSH"
47 110 PRINT" <<<GOOD LUCK>>>"
48 112 PRINT"MULTICS IS THE DEALER AND GETS A BREAK AT 1945 HOURS. WHAT"
49 113 randomize
50 114 PRINT"TIME IS IT NOW";
51 116 LET K=0
52 118 LET W1=0
53 120 INPUT N
54 122 FOR I = 1TO N/2
55 124 let x=t10*rnd
56 126 NEXT I
57 128 DIM D52
58 130 FOR A=1 TO 52
59 132 LET DA = 0
60 134 NEXT A
61 136 DIM Q52
62 138 FOR A=0 TO 39 STEP 13
63 140 FOR C=1 TO 13
64 142 LET QA+C=C
65 144 NEXT C
66 146 NEXT A
67 148 PRINT
68 150 LET K=K+1
69 152 FOR P=1 TO 5
70 154 LET EP=0
71 156 LET VP = 0
72 158 LET TP=0
73 160 NEXT P
74 162 LET V3=1
75 164 PRINT
76 166 PRINT "WAGER";
77 168 LET P=1
78 170 INPUT W
79 172 LET W2=W
80 174 IF W<=0 THEN 582
81 176 IF W<=500 THEN 182
82 178 PRINT "THAT'S TOO MUCH - HOUSE LIMIT IS $500."
83 180 GOTO 166
84 182 PRINT
85 184 PRINT "I SHOW ",
86 186 GOSUB 366
87 188 IF E1=0 THEN 192
88 190 LET V4=1
89 192 LET V5=1
90 194 GOSUB 366
91 196 LET M=X
92 198 LET P=2
93 200 PRINT "FIRST CARD IS",
94 202 GOSUB 366
95 204 LET G=X
96 206 PRINT "NEXT CARD IS",
97 208 GOSUB 366
98 210 IF V2>0 THEN 262
99 212 LET S=X
100 214 IF V3<>1 THEN 262
101 216 IF TP<>21 THEN 230
102 218 PRINT "***BLACKJACK***"
103 220 PRINT "MY HOLE CARD WAS ",
104 222 LET X=M
105 224 GOSUB 434
106 226 LET W1=W1+1.5*W
107 228 GOTO 538
108 230 IF V4=0 THEN 250
109 232 PRINT "INSURANCE ANYONE TYPE 1 OR 0";
110 234 INPUT I
111 236 IF I=0 THEN 250
112 238 IF T1<>21 THEN 246
113 240 LET W1=W1+W
114 242 PRINT "YOU WIN $";W;" ON YOUR INSURANCE BET";
115 244 GOTO 250
116 246 LET W1=W1-W/2
117 248PRINT"YOU LOST $";W/2;" ON INSURANCE BET - I DONT HAVE BLKJAK"
118 250 IF T1<>21 THEN 262
119 252 PRINT "**I HAVE BLACKJACK**"
120 254 PRINT "MY HOLE CARD IS ",
121 256 LET X=M
122 258 GOSUB 434
123 260 GOTO 534
124 262 IF TP<=21 THEN 278
125 264 IF EP>0 THEN 274
126 266 PRINT "YOU BUSTED, ";
127 268 PRINT "YOUR TOTAL IS ";TP
128 270 IF V2=1 THEN 328
129 272 GOTO 494
130 274 LET EP=EP-1
131 276 LET TP=TP-10
132 278 IF V1=2 THEN 268
133 280 LET V3=V3+1
134 282 PRINT "HIT";
135 284 INPUT V1
136 286 IF V1<>3 THEN 350
137 288 IF V2>0 THEN 346
138 290 IF V3<>2 THEN 346
139 292 IF QG=QS THEN 298
140 294 PRINT "NOW IS THAT A PAIR "
141 296 GOTO 282
142 298 LET V2=1
143 300 IF QG<>1 THEN 304
144 302 LET V1=2
145 304 LET P=3
146 306 PRINT " PLAY HAND ONE NOW"
147 308 PRINT "FIRST CARD IS",
148 310 LET W3=W
149 312 LET X=G
150 314 GOSUB 318
151 316 GOTO 206
152 318 GOSUB 414
153 320 GOSUB 434
154 322 LET V3=1
155 324 LET TP=C
156 326 RETURN
157 328 LET P=2
158 330 LET V2=2
159 332 PRINT " PLAY HAND TWO NOW"
160 334 PRINT "FIRST CARD IS",
161 336 LET X=S
162 338 GOSUB 318
163 340 IF QG=1 THEN 344
164 342 LET V1=0
165 344 GOTO 206
166 346 PRINT "NO SPLITS NOW -- TRY AGAIN"
167 348 GOTO 282
168 350 IF V1<>2 THEN 360
169 352 IF V3=2 THEN 358
170 354 PRINT "TOO LATE TO DOUBLE, CHARLIE."
171 356 GOTO 282
172 358 LET WP=2*WP
173 360 IF V1>0 THEN 206
174 362 GOTO 268
175 364 REM DEAL
176 366 GOSUB 380
177 368 LET TP=TP+C
178 370 IF V5=0 THEN 376
179 372 LET V5=0
180 374 RETURN
181 376 GOSUB 434
182 378 RETURN
183 380 LET N=10 *1+ABSCOSN+W1
184 382 FOR A=1 TO N
185 384 let x=int52.9999999*rnd
186 386 IF X=0 THEN 384
187 388 NEXT A
188 390 IF DX=0 THEN 410
189 392 LET R=R+1
190 394 IF R<50 THEN 380
191 396 FOR A=1 TO 52
192 398 IF DA =K THEN 402
193 400 LET DA=0
194 402 NEXT A
195 404 LET R=0
196 406 PRINT "I RESHUFFLED"
197 408 GOTO 380
198 410 LET R=0
199 412 LET DX=K
200 414 IF QX<>1 THEN 422
201 416 LET C=11
202 418 LET EP=EP+1
203 420 RETURN
204 422IF QX>10 THEN 428
205 424 LET C=QX
206 426 RETURN
207 428 LET C=10
208 430 RETURN
209 432 REM PRINT CARD
210 434 GOSUB 440
211 436 GOSUB 470
212 438 RETURN
213 440 IF QX<>1 THEN 446
214 442 PRINT " ACE ";
215 444 RETURN
216 446 IF QX>10 THEN 452
217 448 PRINT QX;
218 450 RETURN
219 452 IF QX>11 THEN 458
220 454 PRINT " JACK ";
221 456 RETURN
222 458 IF QX>12 THEN 464
223 460 PRINT " QUEEN ";
224 462 RETURN
225 464 PRINT " KING ";
226 466 RETURN
227 468 REM PRINT SUIT
228 470 IF X>39 THEN 480
229 472 IF X>26 THEN 484
230 474 IF X>13 THEN 488
231 476 PRINT "OF SPADES"
232 478 RETURN
233 480 PRINT "OF CLUBS"
234 482 RETURN
235 484 PRINT "OF HEARTS"
236 486 RETURN
237 488 PRINT "OF DIAMONDS"
238 490 RETURN
239 492 REM DEALER PLAYS
240 494 LET P=2
241 496 PRINT "MY HOLE CARD IS ",
242 498 LET X=M
243 500 GOSUB 434
244 502 IF T2<22 THEN 508
245 504 IF V2=0 THEN 534
246 506 IF T3>21 THEN 534
247 508 LET P=1
248 510 IF T1<17 THEN 548
249 512 IF T1>17 THEN 516
250 514 IF E1>0 THEN 548
251 516 IF T1>21 THEN 554
252 518 LET P=2
253 520 PRINT "MY TOTAL IS ";T1
254 522 IF TP>21 THEN 534
255 524 IF T1>21 THEN 530
256 526 IF T1>TP THEN 534
257 528 IF T1=TP THEN 536
258 530 LET W1=W1+WP
259 532 GOTO 536
260 534 LET W1=W1-WP
261 536 IF V2>0 THEN 542
262 538 GOSUB 566
263 540 GOTO 150
264 542 LET P=3
265 544 LET V2=0
266 546 GOTO 522
267 548 PRINT "I DRAW ",
268 550 GOSUB 366
269 552 GOTO 508
270 554 IF E1= 0 THEN 562
271 556 LET E1 = E1 -1
272 558 LET T1=T1-10
273 560 GOTO 508
274 562 PRINT "I BUSTED***";
275 564 GOTO 518
276 566 IF W1<0 THEN 574
277 568 IF W1=0 THEN 578
278 570 PRINT"YOU'RE AHEAD $";W1
279 572 RETURN
280 574 PRINT "YOU'RE BEHIND $";-W1
281 576 RETURN
282 578 PRINT "YOU'RE EVEN"
283 580 RETURN
284 582 END
285
286