Blackjack. Don’t go over 21.
Appears on
One of a series of library tapes. Programs on these tapes were renamed to a number series. This tape contained programs 20001 to 20050. These tapes were compiled by Tony Willing.
Gallery
Source Code
10 REM SAVE "21" LINE 4000 20 DIM v(10) 30 LET a=0 40 LET s=a 50 LET p=a 60 LET n=1 70 GO SUB 1000 80 LET p=1 90 LET n=6 100 GO SUB 1000 110 LET p=0 120 LET n=2 130 GO SUB 1000 140 GO SUB 2000 150 GO TO 130 160 LET p=1 170 LET n=7 180 GO SUB 1000 190 LET n=n+1 200 GO TO 180+2830*(b>16) 1000 LET v(n)=INT (2+RND*13) 1010 LET b=v(n) 1020 LET t=(n-1-p*5)*6 1030 PLOT 8*t+3,8*(21-p*10): DRAW 40,0: DRAW 0,-56: DRAW -40,0: DRAW 0,56 1035 LET z=INT (RND*4)+1 1040 PRINT AT 1+p*10,1+t;STR$ b AND b<11;"A" AND b=11;"J" AND b=12;"Q" AND b=13;"K" AND b=14 1045 IF z=1 OR z=2 THEN INK 2 1047 PRINT AT 2+p*10,1+t;"\a" AND z=1;"\b" AND z=2;"\c" AND z=3;"\d" AND z=4: INK 0 1050 FOR i=1+5*p TO 5+5*p 1060 IF v(i)=11 THEN LET a=a+1 1070 LET s=s+v(i)*(v(i)<12)+10*(v(i)>11) 1080 IF s>21 AND a THEN GO SUB 1150 1090 NEXT i 1100 LET a=0 1110 PRINT AT 8+10*p,0;"TOTAL=";s: PAUSE 60 1120 IF s>21 THEN GO TO 3000 1130 LET b=s: LET s=0 1140 RETURN 1150 LET s=s-10 1160 LET a=a-1 1170 RETURN 2000 PRINT AT 21,0;"Hit or Stop?" 2010 GO TO 2010+10*(INKEY$<>"") 2020 PRINT AT 21,0;" " 2030 GO TO 2040+970*(INKEY$="S" OR INKEY$= "s") 2040 LET n=n+1 2050 RETURN 3000 PRINT AT 8+10*p,0;"##BUSTED##" 3010 LET p=p+1 3020 LET s=0 3030 IF p=1 THEN GO TO 160 3040 PAUSE 600 3050 CLS 3060 RUN 20 4000 RESTORE : DATA 102,255,255,126,60,24,24,0,16,56,124,254,124,56,16,0,16,56,124,254,254,102,16,0,16,56,16,84,254,84,16,0 4010 FOR i=0 TO 7: READ a: POKE USR "a"+i,a: NEXT i 4020 FOR i=0 TO 7: READ a: POKE USR "b"+i,a: NEXT i 4030 FOR i=0 TO 7: READ a: POKE USR "c"+i,a: NEXT i 4040 FOR i=0 TO 7: READ a: POKE USR "d"+i,a: NEXT i 4050 POKE 23658,8: CLS : RUN 20