520 GOSUB 370: IF SUIT = 2 THEN DECK(3) = DECK(3) -13
530 IF SUIT = 3 THEN DECK(3) = DECK(3) -26
540 IF SUIT = 4 THEN DECK(3) = DECK(3) -39
550 HPLOT 1,0 TO 51,0 TO 51,71 TO 1,71 TO 1,0
560 FOR I = 2 TO 50 STEP 5: HPLOT I,0 TO I,71: NEXT
570 FOR I = 1 TO 70 STEP 5: HPLOT 1,I TO 51,I: NEXT
580 HCOLOR= 5: FOR I = 5 TO 50 STEP 5: HPLOT I,0 TO I,71: NEXT
590 FOR I = 5 TO 70 STEP 5: HPLOT 1,I TO 51,I: NEXT : HCOLOR= 0
600 FOR I = 1 TO 250: NEXT
610 A = 4: GOSUB 370:C = 2: GOSUB 2100:A = 5
620 REM - CHECK FOR DEALER BLACKJACK
630 FOR I = 21 TO 26:DECK(I) = 0: NEXT
640 IF DECK(3) >10 THEN DECK(3) = 10
650 IF DECK(4) >10 THEN DECK(4) = 10
660 IF DECK(3) +DECK(4) = 11 AND DECK(3) = 1 THEN 2230
670 IF DECK(3) +DECK(4) = 11 AND DECK(4) = 1 THEN 2230
680 REM - CHECK FOR POSSIBLE SPLIT
690 IF DECK(1) < >DECK(2) THEN DECK(21) = DECK(1):DECK(22) = DECK(2):F$ = "N": GOTO 780
700 IF DECK(1) = DECK(2) THEN VTAB 23: PRINT "DO YOU WANT TO SPLIT THESE CARDS (Y/N)? ";: GET F$: IF F$ = "N" THEN DECK(21) = DECK(1):DECK(22) = DECK(2): GOTO 950
710 IF F$ < >"Y" THEN 700
720 REM - ERASE 2ND CARD
730 HCOLOR= 7: FOR I = 57 TO 107: HPLOT I,80 TO I,151: NEXT
1470 FOR I = 21 TO 26: IF DECK(I) >10 THEN DECK(I) = 10
1480 NEXT I
1490 FOR I = 21 TO 26: IF DECK(I) = 1 THEN DECK(0) = DECK(0) +1
1500 NEXT
1510 REM - GET DEALER'S TOTAL
1520 T(0) = DECK(21) +DECK(22) +DECK(23) +DECK(24) +DECK(25) +DECK(26): IF T(0) >21 THEN 1660
1530 IF C = 5 AND T(0) <22 THEN HOME : VTAB 21: PRINT "DEALER HAS FIVE CARDS UNDER 22.": GOSUB 190:LOOT = LOOT -W: GOSUB 330: GOSUB 340: IF F = 1 THEN HOME : GOTO 1900
1540 IF C = 5 AND T(0) <22 AND F = 2 THEN HOME : VTAB 22: HTAB 1: GOSUB 290:LOOT = LOOT -W: GOSUB 330: GOSUB 340: HOME : GOTO 1900
1550 IF T(0) <22 THEN HOME : VTAB 21: PRINT "DEALER'S TOTAL IS ";T(0);
1560 IF DECK(0) >0 AND T(0) +10 <22 THEN T(0) = T(0) +10: PRINT " OR ";T(0)
1570 IF F = 2 AND T(2) = -1 THEN VTAB 22: HTAB 1: PRINT "YOUR 1ST HAND'S TOTAL WAS ";T(1): GOSUB 330: GOSUB 340: GOTO 1600
1580 VTAB 22: HTAB 1: PRINT "YOUR TOTAL IS ";T(F): GOSUB 330: GOSUB 340
1590 REM - HIT DEALER
1600 IF T(0) <16 THEN C = C +1:A = A +1: GOSUB 370: GOSUB 2100:DECK(20 +C) = DECK(A): GOTO 1470
1610 IF T(0) <T(1) AND T(0) <T(2) THEN T(0) = 15: GOTO 1600
1620 IF T(0) >T(1) AND T(0) >T(2) THEN 1680
1630 IF (T(0) > = T(1) AND T(1) < > -1) OR (T(0) > = T(2) AND T(2) >0) THEN 1680
1640 IF T(0) <T(1) THEN T(0) = 15: GOTO 1600
1650 IF T(0) <T(2) THEN T(0) = 15: GOTO 1600
1660 HOME : VTAB 21: PRINT "DEALER HAS ";T(0);". HE IS BUSTED !!!"
1670 REM - PAYOFF ROUTINES
1680 IF T(0) >21 AND T(1) >0 AND T(1) <22 THEN LOOT = LOOT +W: VTAB 22: GOSUB 170: GOSUB 330: GOSUB 340: HOME : IF T(2) = 0 THEN TEXT : GOTO 1900
1690 IF T(0) >21 AND T(2) >0 AND T(2) <22 THEN LOOT = LOOT +W: VTAB 22: HTAB 1: GOSUB 310: GOSUB 330
1700 IF T(0) >21 THEN 1760
1710 IF T(0) > = T(1) AND T(1) >0 THEN LOOT = LOOT -W: HOME : VTAB 21: PRINT "DEALER WINS.": GOSUB 190: GOSUB 330: IF T(2) >0 THEN GOSUB 340
1720 IF T(0) <T(1) AND T(1) >0 THEN LOOT = LOOT +W: VTAB 22: PRINT "YOUR 1ST HAND BEATS THE DEALER.": GOSUB 170: GOSUB 330
1730 IF T(0) > = T(2) AND T(2) >0 THEN LOOT = LOOT -W: HOME : VTAB 21: PRINT "DEALER BEATS YOUR 2ND HAND.": GOSUB 250: GOSUB 330
1740 IF T(1) >0 AND T(1) >T(0) THEN LOOT = LOOT +W: HOME : VTAB 22: PRINT "YOUR TOTAL BEATS THE DEALER.": GOSUB 170: GOSUB 330: IF T(2) >0 THEN GOSUB 340
1750 IF T(2) >0 AND T(2) >T(0) THEN LOOT = LOOT +W: HOME : VTAB 22: PRINT "YOUR 2ND HAND BEATS THE DEALER.": GOSUB 270: GOSUB 330
1760 GOSUB 340: TEXT : HOME : GOTO 1900
1770 REM - INITIAL PRINT ROUTINE
1780 HOME : VTAB 4: HTAB 12: INVERSE : PRINT "NIBBLE BLACKJACK": NORMAL : VTAB 1: PRINT "* COPYRIGHT 1985 BY MICROSPARC, INC. *"
1790 VTAB 7: PRINT "YOU MAY WAGER 1-5 COINS ON EACH HAND. IF YOU SPLIT, YOUR WAGER IS DOUBLED AUTOMATICALLY."
1960 HOME :F = 1:W = W -48: VTAB 12: HTAB 15: PRINT "SHUFFLING": GOTO 400
1970 IF C = 5 AND T(0) <22 THEN HOME : VTAB 22: PRINT "DEALER HAS FIVE CARDS UNDER 22.": GOSUB 24:LOOT = LOOT -W: HTAB 20: PRINT "YOUR NET GAIN = ";LOOT: GOSUB 340: GOTO 1900
1980 TEXT : HOME : VTAB 4: PRINT "ARE YOU SURE YOU WANT TO QUIT?";: GET Z$: PRINT : HOME : IF Z$ < >"Y" GOTO 1900
1990 END
2000 REM - DRAW ROUTINES FOR PLAYER'S CARDS
2010 HCOLOR= 0
2020 IF C = 1 THEN HPLOT 1,80 TO 51,80 TO 51,151 TO 1,151 TO 1,80:X = 26:Y = 105
2030 IF C = 2 THEN HPLOT 57,80 TO 107,80 TO 107,151 TO 57,151 TO 57,80:X = 83:Y = 105
2040 IF C = 3 THEN HPLOT 113,80 TO 163,80 TO 163,151 TO 113,151 TO 113,80:X = 138:Y = 105
2050 IF C = 4 THEN HPLOT 169,80 TO 219,80 TO 219,151 TO 169,151 TO 169,80:X = 194:Y = 105
2060 IF C = 5 THEN HPLOT 225,80 TO 275,80 TO 275,151 TO 225,151 TO 225,80:X = 250:Y = 105
2070 IF C = 6 THEN HPLOT 225,0 TO 275,0 TO 275,71 TO 225,71 TO 225,0:X = 250:Y = 25
2080 GOTO 2170
2090 REM - DRAW ROUTINES FOR DEALER'S CARDS
2100 IF C = 2 THEN HPLOT 57,0 TO 107,0 TO 107,71 TO 57,71 TO 57,0:X = 82:Y = 25
2110 IF C = 3 THEN HPLOT 113,0 TO 163,0 TO 163,71 TO 113,71 TO 113,0:X = 138:Y = 25
2120 IF C = 4 THEN HPLOT 169,0 TO 219,0 TO 219,71 TO 169,71 TO 169,0:X = 194:Y = 25
2130 IF C = 1 THEN HPLOT 1,0 TO 51,0 TO 51,71 TO 1,71 TO 1,0:X = 26:Y = 25
2140 IF C = 5 THEN HPLOT 225,0 TO 275,0 TO 275,71 TO 225,71 TO 225,0:X = 250:Y = 25
2150 IF C = 6 THEN HPLOT 225,80 TO 275,80 TO 275,151 TO 225,151 TO 225,80:X = 250:Y = 105
2160 REM - DRAW SUIT AND VALUE - X,Y DETERMINE CENTER OF CARD
2170 ON SUIT GOTO 2180,2190,2200,2210
2180 ROT= 32: HCOLOR= 5: DRAW 14 AT X,Y +20: DRAW DECK(A) AT X +21,Y +44: ROT= 0: DRAW DECK(A) AT X -21,Y -23: HCOLOR= 0: RETURN
2190 DRAW 15 AT X,Y:DECK(A) = DECK(A) -13: ROT= 32: DRAW DECK(A) AT X +21,Y +44: ROT= 0: DRAW DECK(A) AT X -21,Y -23: RETURN
2200 HCOLOR= 5: DRAW 16 AT X,Y:DECK(A) = DECK(A) -26: ROT= 32: DRAW DECK(A) AT X +21,Y +44: ROT= 0: DRAW DECK(A) AT X -21,Y -23: HCOLOR= 0: RETURN
2210 DRAW 17 AT X,Y:DECK(A) = DECK(A) -39: ROT= 32: DRAW DECK(A) AT X +21,Y +44: ROT= 0: DRAW DECK(A) AT X -21,Y -23: RETURN
2220 REM - DEALER'S BLACKJACK ROUTINE
2230 HCOLOR= 7: FOR I = 0 TO 51: HPLOT I,0 TO I,71: NEXT
2240 HCOLOR= 0:C = 1:A = 50
2250 GOSUB 370: GOSUB 2100
2260 VTAB 21: INVERSE : PRINT "DEALER HAS BLACKJACK !!": NORMAL :LOOT = LOOT -W