home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
enterprs
/
cpm
/
game
/
games.lbr
/
BLKJK.BZS
/
BLKJK.BAS
Wrap
BASIC Source File
|
1993-03-04
|
7KB
|
259 lines
10 PRINT CHR$(26):PRINT:PRINT:PRINT:PRINT:PRINT
20 DIM C(52),V$(10)
30 INPUT "Do you want instructions (Y or N)";ANS$
40 IF LEFT$(ANS$,1)="Y" THEN 2310
50 IF LEFT$(ANS$,1)="y" THEN 2310
60 C=0
70 FOR K=0 TO 3
80 FOR J=1 TO 10
90 C(J+10*K)=J
100 NEXT J:NEXT K
110 FOR J=41 TO 52:C(J)=10:NEXT J
120 V$(1)=" A"
130 V$(2)=" 2"
140 V$(3)=" 3"
150 V$(4)=" 4"
160 V$(5)=" 5"
170 V$(6)=" 6"
180 V$(7)=" 7"
190 V$(8)=" 8"
200 V$(9)=" 9"
210 V$(10)="10"
220 L=40
230 IF L<40 THEN 320
240 FOR J=1 TO 52
250 Z=C(J)
260 R=INT(RND(J)*52+1)
270 C(J)=C(R)
280 C(R)=Z
290 NEXT J
300 L=1
310 PRINT " - - NEW DECK - - ":PRINT
320 T=0
330 T1=0
340 S=0
350 S1=0
360 PRINT:PRINT:INPUT"BET = ";B
370 IF B=0 THEN 240
380 IF B=999 THEN SYSTEM
390 IF B>500 THEN 360
400 IF B<1 THEN 360
410 IF B<> INT(B) THEN 360
420 GOSUB 2050
430 GOSUB 2200
440 PRINT " ";V$(C(L-1))
450 GOSUB 2050
460 GOSUB 2200
470 H=C(L-1)
480 IF C(L-3)=1 THEN 1930
490 IF T=21 THEN 1800
500 IF T1=21 THEN 1880
510 INPUT D$
520 IF LEFT$(D$,1)="G" THEN 1500
530 IF LEFT$(D$,1)="g" THEN 1500
540 IF LEFT$(D$,1)="D" THEN 1470
550 IF LEFT$(D$,1)="d" THEN 1470
560 IF LEFT$(D$,1)="H" THEN 1360
570 IF LEFT$(D$,1)="h" THEN 1360
580 IF LEFT$(D$,1)="S" THEN 620
590 IF LEFT$(D$,1)="s" THEN 620
600 PRINT" RETYPE: ";
610 GOTO 510
620 IF C(L-2)<>C(L-4) THEN 600
630 PRINT"FIRST HAND"
640 B1=B
650 PRINT V$(C(L-2))
660 X=C(L-2)
670 T1=X
680 GOSUB 2050
690 IF X<>1 THEN 720
700 T1=T1+10
710 GOTO 960
720 INPUT D1$
730 IF LEFT$(D1$,1)="G" THEN 960
740 IF LEFT$(D1$,1)="g" THEN 960
750 IF LEFT$(D1$,1)="D" THEN 930
760 IF LEFT$(D1$,1)="d" THEN 930
770 IF LEFT$(D1$,1)="H" THEN 800
780 IF LEFT$(D1$,1)="h" THEN 800
790 PRINT" RETYPE: ";:GOTO 720
800 GOSUB 2050
810 IF T1>0 THEN 870
820 X1=0
830 C=C-B1
840 B1=0
850 PRINT"BUST"
860 GOTO 980
870 INPUT D1$
880 IF LEFT$(D1$,1)="G" THEN 960
890 IF LEFT$(D1$,1)="g" THEN 960
900 IF LEFT$(D1$,1)="H" THEN 800
910 IF LEFT$(D1$,1)="h" THEN 800
920 PRINT" RETYPE: ";:GOTO 870
930 B1=2*B
940 GOSUB 2050
950 IF T1=0 THEN 820
960 PRINT:PRINT T1
970 X1=T1
980 PRINT"SECOND HAND"
990 B2=B
1000 PRINT V$(X)
1010 T1=X
1020 GOSUB 2050
1030 IF X<>1 THEN 1060
1040 T1=T1+10
1050 GOTO 1320
1060 INPUT D1$
1070 IF LEFT$(D1$,1)="G"THEN 1320
1080 IF LEFT$(D1$,1)="g"THEN 1320
1090 IF LEFT$(D1$,1)="D" THEN 1300
1100 IF LEFT$(D1$,1)="d" THEN 1300
1110 IF LEFT$(D1$,1)="H" THEN 1140
1120 IF LEFT$(D1$,1)="h" THEN 1140
1130 PRINT " RETYPE: ";:GOTO 1060
1140 GOSUB 2050
1150 IF T1>0 THEN 1230
1160 X2=0
1170 C=C-B2
1180 B2=0
1190 PRINT"BUST";
1200 IF X1>0 THEN 1510
1210 PRINT " ";V$(H)
1220 GOTO 1610
1230 INPUT D1$
1240 IF LEFT$(D1$,1)="G" THEN 1320
1250 IF LEFT$(D1$,1)="g" THEN 1320
1260 IF LEFT$(D1$,1)="H"THEN 1140
1270 IF LEFT$(D1$,1)="h"THEN 1140
1280 PRINT " RETYPE: ";:GOTO 1230
1290 B2=2*B
1300 GOSUB 2050
1310 IF T1=0 THEN 1160
1320 PRINT:PRINT T1
1330 B=B1+B2
1340 X2=T1
1350 GOTO 1510
1360 GOSUB 2050
1370 IF T1>0 THEN 1410
1380 PRINT"BUST";
1390 PRINT" ";V$(H)
1400 GOTO 1670
1410 INPUT D$
1420 IF LEFT$(D$,1)="G" THEN 1500
1430 IF LEFT$(D$,1)="g" THEN 1500
1440 IF LEFT$(D$,1)="H" THEN 1360
1450 IF LEFT$(D$,1)="h" THEN 1360
1460 PRINT " RETYPE: ";:GOTO 1410
1470 B=2*B
1480 GOSUB 2050
1490 IF T1=0 THEN 1380
1500 PRINT:PRINT T1;
1510 PRINT" ";V$(H);
1520 GOTO 1550
1530 GOSUB 2200
1540 PRINT" ";V$(C(L-1));
1550 IF T<17 THEN 1530
1560 IF T>21 THEN 1590
1570 PRINT":";T
1580 GOTO 1630
1590 PRINT": BUST"
1600 C=C+B
1610 PRINT"YOU HAVE $";C
1620 GOTO 230
1630 IF LEFT$(D$,1)="S" THEN 1690
1640 IF LEFT$(D$,1)="s" THEN 1690
1650 IF T1>T THEN 1600
1660 IF T1=T THEN 1610
1670 B=-B
1680 GOTO 1600
1690 IF T>X1 THEN 1780
1700 IF T=X1 THEN 1720
1710 C=C+B1
1720 IF T>X2 THEN 1760
1730 IF T=X2 THEN 1610
1740 C=C+B2
1750 GOTO 1610
1760 C=C-B2
1770 GOTO 1610
1780 C=C-B1
1790 GOTO 1720
1800 IF T1=21 THEN 1850
1810 C=C-B
1820 PRINT" ";V$(H);
1830 PRINT" BLACKJACK"
1840 GOTO 1610
1850 PRINT"BLACKJACK"
1860 PRINT " ";
1870 GOTO 1820
1880 PRINT"BLACKJACK"
1890 PRINT" ";V$(H);
1900 PRINT
1910 C=C+1.5*B
1920 GOTO 1610
1930 INPUT" INSURANCE ";I$
1940 IF LEFT$(I$,1)="Y" THEN 1980
1950 IF LEFT$(I$,1)="y" THEN 1980
1960 PRINT " ";
1970 GOTO 490
1980 IF T=21 THEN 2010
1990 C=C-.5*B
2000 GOTO 1960
2010 PRINT " 10";
2020 IF T1<>21 THEN 1830
2030 C=C+B
2040 GOTO 1830
2050 IF T1>10 THEN 2090
2060 IF C(L)<>1 THEN 2090
2070 T1=T1+10
2080 S1=1
2090 T1=T1+C(L)
2100 PRINT V$(C(L));" ";
2110 L=L+1
2120 IF T1<=21 THEN 2190
2130 IF S1=0 THEN 2170
2140 T1=T1-10
2150 S1=0
2160 GOTO 2190
2170 T1=0
2180 PRINT
2190 RETURN
2200 IF T>10 THEN 2240
2210 IF C(L)<>1 THEN 2240
2220 T=T+10
2230 S=1
2240 T=T+C(L)
2250 L=L+1
2260 IF T<=21 THEN 2300
2270 IF S=0 THEN 2300
2280 T=T-10
2290 S=0
2300 RETURN
2310 PRINT CHR$(26):PRINT:PRINT
2315 PRINT"This blackjack program enables the operator to play head-"
2320 PRINT"to-head with the computer, simulating the exact rules as those"
2330 PRINT"on the Las Vegas strip. The cards are dealt from one 52-card"
2340 PRINT"deck until a hand starts with less than 12 cards remaining, in"
2350 PRINT"which case it reshuffles. The dealer MUST hit through a total"
2360 PRINT"of 16 and stand on all totals of 17 and above."
2370 PRINT:PRINT:INPUT"TYPE <RETURN> TO GO ON";W9
2380 PRINT CHR$(26);
2385 PRINT"The INSURANCE bet is offered at half the player's bet when"
2390 PRINT"the dealer's up-card is an Ace.":PRINT
2400 PRINT"You may DOUBLE-DOWN on any two cards, and receive one more"
2410 PRINT"card while the original bet is doubled.":PRINT
2420 PRINT"You may split any hand, but resplitting is not allowed."
2430 PRINT"Also, only one card is dealt on each of a pair of aces.":PRINT
2440 PRINT"Your cards appear in the far left column; the dealer's on the"
2450 PRINT"far right. ":PRINT
2460 PRINT" THE COMMANDS ARE AS FOLLOWS:"
2470 PRINT" HIT (draw another card)"
2480 PRINT" GOOD (stand on current total)"
2490 PRINT" DOUBLE (double your bet and draw one card)"
2500 PRINT" SPLIT (form two hands from a pair with the original"
2510 PRINT" bet on each hand)"
2520 PRINT:PRINT"Commands may be typed in as the FIRST LETTER"
2530 PRINT "To exit program enter 999 as a bet":PRINT" - GOOD LUCK! - ":PRINT
2535 INPUT "PRESS <RETURN> TO START GAME";W9:PRINT CHR$(26)
2540 GOTO 60
enter 999 as a bet":PRINT" - GOOD LUCK! - ":PRINT
25