Source Code
10 PAPER 7: INK 0: FLASH 0: BORDER 7: CLS
20 FOR i=1 TO 4: READ x$: FOR j=0 TO 7: READ x: POKE USR x$+j,x: NEXT j: NEXT i
30 DATA "H",34,119,127,127,62,62,28,8,"C",28,28,8,107,127,107,8,8,"D",8,28,62,127,62,28,8,0,"S",8,28,62,127,127,127,107,8
40 LET S$="HCDS": LET V$="A23456789TJQK"
50 DIM c(52): DIM t(52): DIM v(52): DIM s(4)
60 FOR i=1 TO 4: LET s(i)=CODE s$(i)+79: NEXT i
70 FOR i=1 TO 52: LET c(i)=i: NEXT i
80 FOR i=1 TO 52: LET r=INT (52*RND)+1: LET z=c(i): LET c(i)=c(r): LET c(r)=z: NEXT i
90 FOR i=1 TO 52: LET t(i)=INT ((c(i)-1)/13)+1: LET v(i)=c(i)-13*(t(i)-1): NEXT i
100 GO SUB 900
110 PLOT 55,152: DRAW 193,0: DRAW 0,-81: DRAW -193,0: DRAW 0,81
120 PRINT INK 1;AT 4,0;"PLAYER";AT 10,0;"HOUSE"
130 LET m=50: PRINT AT 5,2;"$";m: LET b=10: LET cd=1
140 PRINT AT 0,7;"B L A C K J A C K"
200 FOR g=1 TO 5: GO SUB 900: PAUSE 100
210 PRINT AT 15,2;"Hand no.";g;". The bet is $";b
220 PAUSE 150
230 LET incm=-b: GO SUB 650
240 LET playersgo=1: GO SUB 800: LET pt=total
250 IF pt>21 THEN PRINT AT 6,2; INVERSE 1; INK 2;"BUST": PRINT AT 18,6;"You bust! The house wins.": GO TO 380
260 IF pt=21 THEN PRINT AT 16,6;"You have exactly 21!": GO TO 310
270 INPUT "Press ENTER to stick, any other key to twist"; LINE z$: IF z$="" THEN GO TO 300
280 GO SUB 850: LET pt=pt+inct: PRINT AT 7,4;pt: GO TO 250
300 PRINT AT 16,8;"You stick with ";pt
310 PAUSE 200
320 LET playersgo=0: GO SUB 800: LET ht=total
330 IF ht>21 THEN PRINT AT 12,2; INVERSE 1; INK 2;"BUST";AT 18,6;"The house bust! You win.": GO TO 370
340 IF ht<=pt AND ht<19 THEN GO SUB 850: LET ht=ht+inct: PRINT AT 13,4;ht: GO TO 330
350 IF ht>pt THEN PRINT AT 18,8;"The house wins": GO TO 380
360 IF ht=pt THEN PRINT AT 18,9;"It is a draw": LET incm=b: GO SUB 650: GO TO 380
370 PRINT AT 19,11;"You gain $";2*b: LET incm=2*b: GO SUB 650
380 INPUT "Press ENTER to continue"; LINE z$
390 NEXT g: PRINT AT 20,3;"That's it. You have $";m
400 PAUSE 150: INPUT "Press ENTER to play again, or 0 to stop"; LINE z$: IF z$="" THEN RUN
410 STOP
500 PAPER 7: LET vn=v(n): LET sn=t(n): INK 2-(sn=2*INT (sn/2))*2
510 PRINT AT l1,c1;v$(vn);" ";AT l1+1,c1;" ";CHR$ s(sn)
520 INK 0
530 PLOT c1*8-1,176-8*l1: DRAW 17,0: DRAW 0,-17: DRAW -17,0: DRAW 0,17
540 BEEP 1,5: RETURN
650 LET m1=+incm
660 FOR i=m TO m1 STEP 1-2*(m1<m)
670 PRINT AT 5,3;i;" ": BEEP .01,15
680 NEXT i
690 LET m=m1: RETURN
800 LET l1=10
810 IF playersgo THEN LET l1=4
820 LET c1=8: LET n=cd: LET cd1=cd: LET cd=cd+1: GO SUB 500: LET c1=11: LET n=cd: LET cd=cd+1: GO SUB 500
830 LET total=v(cd-1)+v(cd-2): PRINT AT l1+3,0; INK 1;"Sum:";total
840 RETURN
850 PRINT AT 17,13; INK 3; FLASH 1;"TWIST": PAUSE 150: PRINT AT 17,13;" "
860 LET c1=3*(cd-cd1+1)+5: LET n=cd: GO SUB 500
870 LET inct=v(cd): LET cd=cd+1
880 RETURN
900 FOR i=15 TO 19: PRINT AT i,0;" ": NEXT i
910 PRINT AT 6,2;" ";AT 7,0;" ";AT 12,2;" ";AT 13,0;" "
920 FOR i=3 TO 12: PRINT PAPER 4;AT i,7;" ": NEXT i
930 RETURN
9997 STOP
9998 SAVE "BLACK JACK" LINE 0