--- title: "Blackjack (1000)" id: 51372 type: "computer_media" slug: "blackjack" url: "http://localhost/computer_media/blackjack/" markdown_url: "http://localhost/computer_media/blackjack.md" published_at: "2023-07-29T14:32:30+00:00" modified_at: "2026-04-03T07:59:21+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2021/01/Silicon-Mtn-Blackjack.png" excerpt: "A casino Blackjack game with high-resolution card graphics, multi-deck shuffling, bankroll tracking, and a clever fast-save/load system using a POKE flag." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "SyncWare Co." slug: "syncware-co" taxonomy: "post_tag" url: "http://localhost/tag/syncware-co/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Fred Nachbaur" slug: "fred-nachbaur" taxonomy: "indiv" url: "http://localhost/indiv/fred-nachbaur/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_type: "Cassette" programmers: - name: "Fred Nachbaur" slug: "fred-nachbaur" taxonomy: "indiv" url: "http://localhost/indiv/fred-nachbaur/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Blackjack%20WRX%20%28198x%29%28Nachbaur%2C%20Fred%29%28US%29%28TS1000%29%28Program%29.zip" mediadate: "1985" images: - url: "http://localhost/wp-content/uploads/2021/01/Silicon-Mtn-Blackjack.png" article_media: - id: 15372 title: "High-Res Blackjack for the ZX81/TS1000/TS1500" type: "article" url: "http://localhost/article/high-res-blackjack-for-the-zx81-ts1000-ts1500/" related_products: - id: 35780 title: "High-Res Blackjack" type: "product" url: "http://localhost/product/high-res-blackjack/" media_type_tags: "Game" --- # Blackjack (1000) Blackjack (1000) is a full-featured casino-style Blackjack game that leverages an external high-resolution graphics extension (“[SRAM Hi-Res Extended BASIC](http://localhost/computer_media/sram-hi-res-extended-basic/),” or SHREB) stored in an 8K SRAM expansion. The game manages a configurable number of decks, a full card shuffle routine (Fisher-Yates style swap loop at lines 850–910), player bankroll tracking, and standard Blackjack rules including ace handling, bust detection, and push outcomes. High-resolution card graphics are rendered using UDG (User-Defined Graphics) data loaded via LPRINT commands to the SHREB package, with sprite data for card rank numerals defined at lines 9021–9022. A fast-save/fast-load facility at line 9100 uses POKE to a flag address (32600) to distinguish save versus load passes, preserving game state across sessions. *** ## Program Analysis ### Program Structure The program is organized into clearly delineated functional blocks by line number range: | Line Range | Purpose | | --- | --- | | 0–1 | REM blocks containing machine code / SHREB loader data | | 3, 5–6 | Title and startup REMs | | 10–70 | PRINT subroutine — renders a card to the hi-res screen | | 100–130 | Draws a face-down (hidden) card back | | 200–330 | GET subroutine — deals next card from deck, updates game state | | 400–420 | Message display subroutine with pause | | 500–510 | Screen-clear helper (prints blank spaces) | | 700–940 | CREATE subroutine — builds and shuffles the deck | | 2000–2090 | Title screen with hi-res dealer sprite (“Vegas Bob”) | | 2100–2195 | Name and bankroll input, deck count selection | | 2200–2395 | Main game setup: deal initial four cards, check for Blackjack | | 2400–2795 | Game logic — dealer and player turn, ace adjustment, hit/stand | | 2800–2930 | Bust and Blackjack outcome handling | | 3000–3499 | Win/lose/push resolution, bankroll update, replay loop | | 8900 | SAVE line for the program itself | | 9000–9017 | UDG data upload to SHREB via LPRINT | | 9020–9022 | Sprite data upload (card rank glyphs) via LPRINT SD | | 9050 | Entry-point redirect to line 2000 | | 9100–9160 | Fast save/load facility using POKE flag | | 16000 | Trailing REM (likely a label or note) | ### SHREB Integration Nearly every graphics and I/O operation is guarded by `IF USR HR THEN`, where `HR` holds the entry address of the SHREB machine-code routine. This idiom lets the program degrade gracefully if SHREB is absent: all hi-res output is simply skipped, and the game still runs in text mode. The `USR HR` call returns a true/false flag indicating whether the extension is active. SHREB is communicated with via redirected LPRINT commands. The tokens `U`, `SD`, `R`, `C`, `D`, and `XD` appearing as the first argument to LPRINT are SHREB command codes rather than standard BASIC variables. UDG pixel data (lines 9001–9017) and sprite data (lines 9021–9022) are uploaded as comma-separated hex byte strings. Lines 9001–9017 define 64 UDGs covering card suit symbols, playing-card face art, and miscellaneous graphics. Lines 9021–9022 define 26 sprite frames for card rank characters (A, 2–9, T, J, Q, K) in two size variants starting at sprite indices 1 and 14. ### Deck and Card Representation The deck string `B$` is dimensioned to `52*ND` characters (line 730), supporting multiple decks controlled by user input `ND`. Each card is encoded as a single character with `CHR$ C` for `C` from 1 to 52 (line 760), repeated across each deck. The shuffle at lines 850–910 uses a standard random-swap pass over the entire deck string. Card decoding in the GET subroutine (line 210) extracts a raw index `R = CODE B$(J) - N1`, then computes suit `H = INT(R/13)+N1` and rank `I = R-(H-N1)*13+N1`. The variable `N1` is used throughout as a constant equal to 1, and `N0` as 0, a common memory-saving idiom. ### Game State Array A six-element array `D(6)` tracks game state. Its slots are used as follows: | Index | Contents | | --- | --- | | D(1) / D(N1) | Player card count | | D(2) | Dealer card count | | D(3) | Ace-adjustment flag for player | | D(4) | Ace-adjustment flag for dealer | | D(5) | Player hand total | | D(6) | Dealer hand total | A secondary array `A(9,2)` stores up to nine player cards as (suit, rank) pairs for later graphical replay of the hand after the round ends (lines 3280–3340). ### Ace Handling Ace logic is implemented across multiple locations. When an ace is first dealt (`I=N1`), `D(T+3)` is set to 1 as a soft-ace flag (line 310). At line 2470, if the player total is between 8 and 11 inclusive and the soft flag is set, 10 is added to the total (line 2480) and the flag is negated to `-N1`. The reverse adjustment at lines 2530–2540 subtracts 10 and toggles the flag sign when a bust is detected, implementing the standard soft/hard ace conversion. ### Blackjack Detection and Outcome Logic Line 2390 checks for an immediate Blackjack: `D(4)*D(6)=11` tests whether the dealer’s ace flag times the dealer’s total equals 11, which is true only when the dealer holds a natural 21 starting with an ace. The player outcome comparison uses the computed expression `GOTO (D(5)>D(6))*100+3000` at line 2795, branching to line 3100 (lose) when false (result 3000) or line 3100+100=… — actually to line 3100 on false and an alternate target on true — as a compact branchless-style dispatch. ### Fast Save/Load Facility The subroutine at line 9100 implements a two-pass save/load using address 32600 as a flag byte. On the first execution, it POKEs 1 to that address and calls SAVE. After the program reloads, it checks whether the flag is still 1 to decide whether to SAVE the data array `S` or LOAD it back, then resumes at line 2120. This sidesteps the lack of a combined SAVE/LOAD primitive. ### Key BASIC Idioms - `N1` and `N0` used as constants 1 and 0 throughout to reduce token storage. - `GO TO VAL "number"` and `GOSUB VAL "number"` as a memory optimization for frequently targeted lines. - `LET D=Z$="Y"` (line 2670) assigns a boolean 1 or 0 directly from a string comparison. - `GOTO (expression)*100+3000` (line 2795) as an arithmetic branch to avoid an explicit IF/GOTO chain. - All hi-res output wrapped in `IF USR HR THEN` for graceful fallback. ### Notable Anomalies Line 2390 tests `D(4)*D(6)=11` to detect dealer Blackjack. This is a somewhat fragile condition: it relies on `D(4)` being 1 (ace flag set) and `D(6)` being 11 (initial ace-counted total). A dealer natural with a face-card and ace would satisfy this only if the ace is counted as 11 from the start, which is the intended initial card value assignment path. The LPRINT-based UDG and sprite upload mechanism (lines 9001–9017, 9021–9022) is unconventional: rather than POKE loops, hex strings are passed to SHREB’s LPRINT handler, which parses and stores them. This is a SHREB-specific feature and would have no effect without the extension active. ## Source Code ``` 0 REM [C]█[1][9][8][7]█[S][M][C]##▘ ""LN RUN ##[P]#Y2 GOSUB #<>5▟▝TAN PRINT # RETURN,C▌LN [*]RNDINT / LET TAN 6-RNDLN #? FASTLN LN + LPRINT TAN LN [H]RND PRINT LN [4]RND7LN [H]RND# LET #TAN 7# RETURN#C▀ RETURN;""6-RNDTAN A ##▞▌ACS 9ACS =( IF ,,▘ 4,,TAN 7LN [T]RNDLN [4]RNDLN ,,INKEY$ ##ACS ZACS ZACS Z##STR$ LN STR$ RND LET J NEW▛W#TAN Y3[)]K▌LN [*]RNDINT (Y[Z][(]SQR LN [*]RNDINT 25 6AT ZA4##<▘ COPY*Q GOSUB [K]TAN NEXT Y▞# ( CLEARLEN LIST W4 CLEAR▞"" CLEARACS ##C▝▞[K])4 5 4##INKEY$ ▌ASN #INKEY$ ;# GOSUB ###[C] LIST E£RND ###) RUN ▙;Y2 GOSUB #Y PRINT ▘▛▝ CLEARACS ##CODE [P]▝LN [>]▝LN 4▝<>5GINKEY$ #[8]▝ CLEARACS #▚/▖ CLEARACS #LEN E£RND▘9 GOSUB PIF FOR 5 █;6#INKEY$ FOR GOSUB [K]LN F?<>5GINKEY$ TAN 7LN [T]RNDLN [4]RND##LN ▞INKEY$ VAL 7LN [H]RNDAT LN STR$ RND#TAN 2 COPY/▝2 STR$ 7LN [T]RNDLN ,,INKEY$ SGN GOSUB ##ZLN LET RND##?( CLEARACS .*PI▌4▝▞▒▛( CLEAR#TAN Y COPY/▘[J]MVAL Z CLEARACS #[:]7LN [T]RNDLN ,,INKEY$ # RETURN,4"7 GOSUB ##ZLN [T]RNDLN ,,INKEY$ ## GOSUB ##ZVAL #[)]-▘K▖ GOSUB #- COPY4▝- FAST##MSQR Z LET [(]2▘K▖ GOSUB #2 COPY4▝2 ##MINT Z#[W]S▞##- /▝2 GOSUB #SGN Z6PEEK Z#[B]3#A 6STR$ ZAT VAL Y[Z][(] PRINT UVAL Z# LET CLEARACS ##4▌LN SGN INKEY$ /▀LN ##UPEEK Z#▞ USTR$ Z##,,#MSTR$ Z GOSUB #SGN ZUUSR Z# GOSUB PIS▒#MSTR$ Z GOSUB #INT ZAT #▙##▄#5CHR$ ZOUUSR Z[Y]4[N] GOSUB ##ZTAN Y COPY/▘[J]MVAL Z7LN [T]RNDLN [4]RNDVAL 7LN [H]RND#I 6INT Z#6SGN ZAT Y▘ PRINT VAL VAL EINT Z GOSUB #SGN Z▞▌VAL ACS EACS .( IF [R] GOSUB #6INT Z GOSUB #SGN ZAT ACS GACS 1( IF ;6SGN Z GOSUB #INT ZAT #ACS <[~~]##ACS +[£]#Y[Z][(]S,, PRINT UVAL Z# LET LN SGN INKEY$ AT LET W RETURNASN S[O]TAN Y▘MINT ZLN COS RNDCOS LN [H]RNDMINT ZLN TAN RNDCOS 7LN [T]RNDLN [4]RND[S]S▀#INKEY$ #LN (INKEY$ #INKEY$ LN (INKEY$ #PI GOSUB #SQR Z[)]W PRINT 7LN [T]RND[S]K▀#INKEY$ # GOSUB #ABS Z[(]W4▘XSGN # GOSUB #USR ZUPEEK Z#USGN Z#[B]LN INPUT RND6CHR$ ZUABS Z#USGN Z#[B]LN INPUT RND6**Z£TAN LN +#4*UINT Z#5 4▘ /#J#7"#[L]4 RUN +4 INPUT TAN USTR$ ZECHR$ Z GOSUB #**Z6 AND Z GOSUB #>=Z PRINT FAST GOSUB # LPRINT C#UPEEK ZLN INKEY$ STR$ VAL #3ZACS <( IF AT ACS .*( CLS#SGN 7 FAST[B] GOSUB # LPRINT C▌#J#/ NEXT UABS ZLN INKEY$ Y,,[(]#VAL ,*ZACS 1( IF AT ACS +3( CLS>▘4 E>=Z,,6>=Z FOR E AND Z,,6 AND Z LET X4[A]5INT ZP4[?]TAN UUSR Z RETURN▒4▖,J/NOT UPEEK ZLN INKEY$ VAL ,3ZACS +( IF AT ACS 1*( CLS#UABS ZJ NEW▛C$#,VAL ?ACS 0( CLSAT ACS ▖( UNPLOT #/[E]E(RND#[T]COS RETURN█4▌LN [*]RNDINT ▘VAL LN PAUSE ,,AT FOR / GOTO PRINT SCROLL FAST:RND▟#LN ##7 FAST▞▌[J]#( CLEARSGN LPRINT LET TAN LN SCROLLRND#?( CLEARLN ##K▀Y▟>LN COS RNDTAB SQR #TAN LN SCROLLRND FASTAT LN 4+ FASTLN ##AT FAST##LN PLOT ;LN [~~]+ LPRINT / STEP LN SCROLLRND#▞ / SLOW###Y[Z][(]STR$ VAL PRINT LN SGN INKEY$ LET AT SGN TAN 2 COPY/▝2 STR$ LN C#SGN USTR$ Z#UPEEK Z5SGN Z PRINT FASTLN [D]#+C▞WLN [J]#/ RUN UUSR Z# LPRINT LET F FASTLN [D]#+C▞£LN [J]#/ RUN USTR$ Z# LPRINT UABS Z PRINT FASTLN [D]#+C▞XLN [J]#/ RUN UUSR Z# LPRINT LET 7LN [D]#+COS $LN [J]#/ SAVE LN 7?2"" CLEARACS ##C▝2[K]5 4[J]PEEK CLSLN #?ABS ▐▒<= CLS*K CLS-4▞▒#<= CLS3K CLS# NEW█PEEK CLSACS )( PAUSE 7+4 FOR <= CLS3K CLSLN ##/SGN 76-RNDLN #?LN [B]:##▘▘COS CLEARACS V#""( RAND $4 PLOT .#[N]4 INPUT TAN 7# RETURN#4,,LN OR #LN RUN #/L7# RETURN,C> RETURN;CG RETURN#C# RETURNAT C# RETURNTAB C#/# GOSUB #AT Z# NEW LIST LEN ( RETURNRNDCODE [O]#ATN [J]#/STR$ #LEN ▒#[J]# GOSUB #AT ZTAN ▞ COPY7# RETURN#COS RETURN,4▖Y▖/" RETURN;4VAL ▖# RETURN▀ASN SQR #M""Z/ STOP GOSUB #AT Z/SQR 7LN [T]RND## RETURN[T]ABS =INKEY$ # RETURNRNDABS "INKEY$ GOSUB #AT Z/[?]7LN [H]RND NEWZ GOSUB #AT Z[T]#K GOTO Y▒█#/ NEW6-RNDLN #? FAST CLEARACS ▘#CODE STR$ .LN SAVE < LPRINT FAST#[L]C£,VAL STR$ LN K#SGN AT <"/ LIST LPRINT /CODE RETURN""4▖Y"/U PRINT NEW# RETURNRNDK▛ LET CLEARACS ▘LEN /G CLEARACS ▘#C~~[J] CLEARACS ▘▚LN ##/▖ CLEARACS ▘LEN LET LN #,,~~ PRINT VAL NEW#LN ##AT ▀ LET RETURN█S LET CLEARACS ▘▚[J] GOSUB #AT Z PRINT YZ[)]>=[J]#LN RUN # LET VAL M<=Z[B]*[B]**- ACS >#5 2; FASTACS TLN STR$ RNDSGN U""Z RETURN▖ASN SQR # RETURN▝C# RETURN▘CFY▒ PRINT STR$ , PRINT U""Z[B]4"U<=ZACS #C▖ LET J/▘ LET #)4 ;SGN LET =AT ▌# RETURN COPYC▒USQR Z##[U]KATN USGN Z#UPEEK Z#USTR$ Z# FASTVAL Y[Z][(]2 LN SGN INKEY$ AT ▌ LPRINT H4 LIST 5INT ZP4[6]TAN 7# RETURN0K▌LN [*]RNDINT 1 RETURNGK RUN CHR$ 0TAN LN ▝##ACS 4ACS 4ACS 4ACS 4LN ▝#█#7# RETURN"#TAN 7# RETURN"TAB SQR #7#ACS #C▝CHR$ RND) 77 FAST▞▒A # FOR ;( CLEAR FOR 5 S; FOR LPRINT 7LN =#>4▌76-RNDTAN =Z#J NEW▛WM#RND) STOPZ GOSUB #**ZY▒ PRINT #>~~VAL #U#RND RETURN▌S)JLEN ,,[B]##: C:3ACS ;( CLS/▛#[J]ACS )*( CLS[Q]#7<#>#[Q]#FLN ##=Z) STOPZ▞▒VAL ,#7<,#LN ##F#<( POKE TAN ▞4[J]##ACS [W]>#<( RUN TAN E-RND# RETURN;C# RETURN#C▌LN [*]RNDINT + LPRINT 6-RND▘ TAN E-RND# RETURN THENC▌LN [*]RNDINT ) FAST7#)""#STR$ RETURN LLIST ASN ## RETURN SCROLLASN [:]RND RETURN LOAD ASN B# RETURN LIST ASN 3# RETURN PAUSE ASN ## RETURN PRINT ASN ## RETURN PLOT ASN [Y]INKEY$ RETURN RUN ASN ▟INKEY$ RETURN SAVE ASN [~~]# RETURN RAND ASN ## RETURN CLSASN ;INKEY$ RETURN UNPLOT ASN TAB INKEY$ RETURN CLEARASN ▗INKEY$ RETURN RETURNASN [*]RND RETURN COPYASN /# RETURN LPRINT 4[9]SGN )[J]#STR$ 7# RETURNXC##7# RETURN#C[<] RETURN;4 PLOT # RETURNAASN [▒]# RETURNBASN [B]INKEY$ RETURNCASN [B]PI RETURNDASN SCROLLINKEY$ RETURNIASN ## RETURNLASN [5]# RETURNPASN ## RETURNRASN [T]# RETURNS42F#7 RETURNDASN ## RETURNEASN ▞# RETURNMASN 8# RETURNPASN [1]# RETURNSASN ##/# RETURNTASN ## RETURNUASN F# RETURNW4UF#7 RETURNDASN ## RETURNLASN "# RETURNRASN ▟# RETURNUASN LEN #/57#7# RETURN#C; RETURN;4 PLOT # RETURNCASN [F]PI RETURNDASN FOR INKEY$ RETURNRASN [X]# RETURNTASN ###SQR # 1 REM FAST##▞▛ACS 5>=?#USR RETURN#Y▀X4 CLEAR GOSUB #▌TAB LLIST #ACS 5>=?#USR RETURN#TAN <= RETURNY,X4 CLEARPEEK COPYY>X4 CLEAR#7##>#<= RETURNYDX4 CLEARPEEK COPYY4X4 CLEARF7RTAN ▘ █VAL LN STEP #AT ▌TAB B#▀ GOSUB #LN STEP #LN ##$LN STEP # CLEAR FAST LET #:[E]LN STEP #LN ###LN STEP #LN ###LN STEP # CLEAR FAST LET ##LN STEP #7.#[N]4 PLOT TAN LN SCROLL▝76-RNDLN #? FASTLN SAVE < LPRINT 7#[K]C: RETURN5K~~# RETURNSCOS RETURNVCOS RETURNPCOS INT 0LN ## PRINT ##VAL ) ▝LN ##SGN LN 8# LET E=RND RETURNS4▛5 4##/( RETURNP4▌),,RND/▖ GOSUB #(RND GOSUB # FOR LN 8##▛▝<= RETURN*S CLS: £<= RETURN*K IF #LEN SCROLLACS #AT [J] GOSUB PIAT GOSUB PISGN C,,-▝LN ## LET LPRINT / TO 5WRND,[Y]4 LIST 7<"#[L]4 PRINT LET LPRINT RETURNS4,,5 4LN <>##▛▝ RETURNV4>E(RNDLN <>#FLN [1]=SGN LPRINT LN ▛▝##▞5,,RND/ GOTO 3 REM [B][L][A][C][K][J][A][C][K][-][H][R] 5 REM GOTO 9000 TO START 6 REM 10 REM [P][R][I][N][T] 11 LET Q=24*A-16 12 LET U=96*T+72 15 IF USR HR THEN PRINT ;;;;AT U,Q/4;E$;AT U-72,Q/4;E$; 20 IF NOT T AND D(N1)>N1 THEN GOTO 100 30 FOR L=N1 TO 8 35 IF USR HR THEN PRINT TAB Q/4;" ";C$(H,I,L) 40 NEXT L 45 IF USR HR THEN PRINT AT U-12,Q/4+12;CHR$ (178+H);AT U-60,Q/4;CHR$ (174+H) 50 IF USR HR THEN LPRINT SP;I,Q,262-U;SP;I+13,Q+48,192-U 60 IF USR HR THEN LPRINT R;16+(NOT T)*96,191-96*T,Q-1,Q+56;R;23+(NOT T)*96,184-96*T,Q+7,Q+48 70 RETURN 100 FOR L=N1 TO 8 110 IF USR HR THEN PRINT TAB Q/4;" [R][R][R][R][R]" 120 NEXT L 130 GOTO 60 200 REM [G][E][T] 210 LET R=CODE B$(J)-N1 220 LET J=J+N1 230 LET H=INT (R/13)+N1 240 LET I=R-(H-N1)*13+N1 250 LET D(T+N1)=D(T+N1)+N1 260 IF NOT T THEN LET A(D(N1),N1)=H 270 IF NOT T THEN LET A(D(N1),2)=I 280 LET V=I 290 IF V>10 THEN LET V=10 300 LET D(T+5)=D(T+5)+V 310 IF I=N1 THEN LET D(T+3)=N1 320 LET A=D(T+N1) 330 GOTO 10 400 IF USR HR THEN PRINT AT 84,64-2*LEN Z$;;Z$ 410 IF USR HR THEN PAUSE VAL "90" 420 RETURN 500 IF USR HR THEN PRINT ;;AT 84,N0;E$;E$;E$;E$;" ";AT 84,N0; 510 RETURN 700 REM [C][R][E][A][T][E] 710 FAST 720 LET N=52*ND 730 DIM B$(N) 740 FOR C=N1 TO 52 750 FOR L=C TO N STEP 52 760 LET B$(L)=CHR$ C 770 NEXT L 780 NEXT C 800 RAND 810 FAST 820 CLS 830 PRINT "PLEASE WAIT WHILE I SHUFFLE." 840 PAUSE VAL "120" 850 FOR C=N1 TO N 860 LET L$=B$(C) 870 LET Q=INT (RND*N)+N1 880 LET M$=B$(Q) 890 LET B$(Q)=L$ 900 LET B$(C)=M$ 910 NEXT C 920 IF USR HR THEN CLEAR 930 LET J=N1 940 RETURN 2000 IF USR HR THEN CLEAR 2010 IF USR HR THEN CLS 2040 IF USR HR THEN PRINT AT VAL "80",VAL "20";;"* HIGH-RES *";AT VAL "90",VAL "22";W$;AT VAL "100",VAL "20";"BY F.NACHBAUR" 2050 FOR A=N1 TO VAL "12" STEP VAL "3" 2060 IF USR HR THEN LPRINT R;115+A,80-A,186+A,70-A 2070 NEXT A 2080 IF USR HR THEN PRINT ;;;;AT 16,30;"[S][T]";TAB 30;"[U][V][W]";TAB 30;"[X][Y][Z]";AT 41,30;"[R][R][R]";TAB 28;"[R][R][R][R][R]" 2090 IF USR HR THEN PRINT ;;AT VAL "5",VAL "48";"HI";TAB VAL "44";"THERE.";TAB VAL "42";"IM YOUR";TAB VAL "42";"DEALER,";TAB VAL "42";"""VEGAS";TAB VAL "46";"BOB""" 2100 IF USR HR THEN LPRINT C;196,161,30;D;166,170,140,168;D;169,176;XD;168,169 2110 IF USR HR THEN PRINT AT VAL "130",VAL "14";"WHAT IS YOUR NAME?" 2120 INPUT N$ 2130 IF USR HR THEN PRINT AT 130,N0;" OK,";N$;".";E$;E$;E$;AT 138,N0;"LETS SEE YOUR BANKROLL. $"; 2140 INPUT O 2150 LET O=ABS INT O 2160 IF USR HR THEN PRINT O;AT VAL "150",N0;"PLAY WITH HOW MANY DECKS?" 2180 INPUT ND 2190 GOSUB VAL "700" 2200 IF USR HR THEN CLS 2205 GOSUB 500 2210 IF N-J<14 THEN GOSUB VAL "800" 2215 IF USR HR THEN PRINT "*";O;"* BET="; 2220 INPUT P 2230 LET P=ABS P 2240 IF P<=O AND P<=2000 THEN GOTO 2300 2250 GOSUB 500 2260 IF P>2000 THEN IF USR HR THEN PRINT "LIMIT=$2000; "; 2270 IF USR HR THEN PRINT "BET TOO HIGH" 2280 GOSUB VAL "410" 2290 GOTO VAL "2205" 2300 IF USR HR THEN PRINT "$";P;AT 130,56;"[Y][O][U][R]";TAB 56;"[H][A][N][D]";;;;AT 24,58;"[S][T]";TAB 58;"[U][V][W]";TAB 58;"[X][Y][Z]";TAB 56;"[R][R][R][R]" 2310 DIM D(6) 2315 DIM A(9,2) 2320 LET E=N1 2330 LET D=E 2340 LET T=E 2350 FOR X=E TO 4 2360 GOSUB 200 2370 LET T=NOT T 2380 NEXT X 2390 IF D(4)*D(6)=11 THEN GOTO 2900 2395 GOTO 2440 2400 IF USR HR THEN PRINT AT 84,56;"STAY" 2410 IF NOT E THEN GOTO 2580 2420 LET T=N0 2430 GOSUB 200 2440 IF D(5)>16 THEN GOTO 2500 2450 IF D(3)>N0 THEN GOTO 2470 2460 GOTO 2580 2470 IF D(5)>11 OR D(5)<8 THEN GOTO 2580 2480 LET D(5)=D(5)+10 2490 LET D(3)=-N1 2495 GOTO 2440 2500 IF D(5)<22 THEN GOTO 2560 2510 IF D(3)"Y" AND Z$<>"N" THEN GOTO 2650 2670 LET D=Z$="Y" 2680 IF NOT D THEN GOTO 2400 2690 IF USR HR THEN PRINT AT 84,56;"OK.." 2700 GOSUB 200 2710 IF D(6)>21 THEN GOTO 2800 2720 GOTO 2410 2730 IF D(6)=21 THEN GOTO 3000 2740 IF D(6)<12 THEN GOTO 2760 2750 GOTO 2780 2760 LET D(6)=D(6)+10*D(4) 2770 IF D(6)>11 THEN GOTO 2730 2780 IF D(5)>21 THEN GOTO 3000 2790 IF D(5)=D(6) THEN GOTO 3200 2795 GOTO (D(5)>D(6))*100+3000 2800 LET Z$="---BUST--- " 2810 GOSUB VAL "400" 2820 GOTO VAL "3100" 2900 LET P=2*P 2910 LET Z$=W$ 2920 LET D(6)=D(6)+10 2930 GOSUB VAL "400" 3000 LET Z$="WIN" 3010 LET O=O+P 3020 GOTO 3220 3100 LET Z$="LOSE" 3110 LET O=O-P 3120 GOTO 3220 3200 LET Z$="PUSH" 3210 GOTO 3230 3220 LET Z$="YOU "+Z$+", "+N$ 3230 GOSUB 500 3240 GOSUB VAL "400" 3245 GOSUB VAL "500" 3250 IF USR HR THEN PRINT AT 72,60;D(5);AT 96,60;D(6);AT 84,N0;"**$";O;"** "; 3260 IF O>N1 THEN IF USR HR THEN PRINT "PRESS P TO PLAY" 3270 LET T=N0 3280 FOR A=2 TO D(N1) 3290 LET D(N1)=N0 3300 LET H=A(A,N1) 3310 LET I=A(A,2) 3320 IF INKEY$ ="P" THEN GOTO 3400 3330 GOSUB 10 3340 NEXT A 3400 IF O"P" THEN GOTO 3410 3420 GOTO 2200 3450 GOSUB VAL "500" 3460 IF USR HR THEN PRINT "MONEY ALL GONE. NEXT SUCKER? " 3470 IF INKEY$ ="P" THEN GOTO VAL "2010" 3480 IF INKEY$ <>"Q" THEN GOTO VAL "3470" 3490 CLS 3495 IF USR HR THEN RETURN 3499 STOP 8900 SAVE "BLACKJAC[K]" 9000 REM [U][D][G] 9001 IF USR HR THEN LPRINT U;" ","00,00,00,00,00,00,00,00▘FF,61,2E,10,13,0F,15,15▝FF,04,DB,20,8E,FF,40,40▀FF,10,6E,81,39,FE,03,42▖E0,C0,82,02,05,05,05,85▌00,00,00,00,00,00,03,04▞15,15,25,29,2A,EA,2A,AA▛44,5A,44,40,40,40,80,84▒92,AC,92,42,42,22,A2,66,,85,85,85,85,85,C5,A5,A5" 9002 IF USR HR THEN LPRINT U;"~~","05,04,02,01,00,01,0F,3D 2A,CA,32,C4,39,C7,77,DD£82,80,83,80,02,98,25,52$0A,E1,B9,00,48,A3,54,49:A5,65,25,A5,45,35,BD,5D?77,DD,F7,DD,F6,DD,FA,D5(77,DD,7A,D5,AA,55,AA,55)2C,91,AE,40,AA,55,AA,55>A6,11,0E,40,AA,55,AA,55]95,A5,A9,2A,4A,52,54,54[<]40,40,40,40,81,80,80,80[=]C4,04,02,02,09,C7,28,08[+]05,05,05,05,05,05,05,05" 9012 IF USR HR THEN LPRINT U;"[-]","10,1F,0C,07,02,06,0B,1E[*]95,25,49,8A,F2,0D,A0,E4[/]00,00,E0,1F,00,00,80,41[;]38,64,04,02,FC,08,8C,06[,]A2,E9,A4,EA,B9,E8,B8,E8[.]22,14,88,49,2A,88,88,88[0]23,46,9B,2E,4B,AE,9B,86[1]05,85,C5,E5,B5,E9,BD,EE" 9013 IF USR HR THEN LPRINT U;"[2]","77,BD,97,AD,A7,A3,A1,A0[3]61,D9,75,D2,74,D9,62,C4[4]11,11,11,54,92,11,28,44[5]17,1D,17,9D,57,25,97,45[6]A0,A0,A0,A0,A0,A0,A0,A0[7]60,31,10,3F,40,20,26,1C[8]82,01,00,00,F8,07,00,00[9]27,05,B0,4F,51,92,A4,A9[A]78,D0,60,40,E0,30,F8,08" 9014 IF USR HR THEN LPRINT U;"[B]","10,14,E3,90,40,40,20,23[C]01,01,01,81,02,02,02,02[D]2A,2A,4A,52,54,95,A5,A9[E]64,D4,A4,98,80,00,00,00[F]A4,B8,A0,A0,40,00,00,00[G]16,13,10,10,1F,20,55,FF[H]82,02,02,3F,C0,3F,40,FF[I]AA,AA,FE,02,7E,81,01,FF" 9016 IF USR HR THEN LPRINT U;"[J]","10,38,7C,7C,FE,D6,10,38[K]00,38,38,D6,FE,D6,10,38[L]00,44,EE,BA,D6,6C,38,10[M]00,10,38,6C,C6,6C,38,10[N]1C,08,6B,7F,3E,3E,1C,08[O]1C,08,6B,7F,6B,1C,1C,00[P]08,1C,36,6B,5D,77,22,00[Q]08,1C,36,63,36,1C,08,00[R]44,82,29,11,29,82,44,39" 9017 IF USR HR THEN LPRINT U;"[S]","1F,3D,70,66,6B,46,40,21[T]FC,FE,07,33,6B,31,81,42[U]21,10,12,09,04,0A,31,40[V]42,04,A4,C8,10,28,C6,01[W]00,00,00,00,00,00,00,0F[X]49,88,84,84,82,82,81,FF[Y]C9,88,90,90,A0,24,42,F9[Z]09,89,9D,A9,CF,90,20,4F" 9020 REM [S][P][R][I][T][E][S] 9021 IF USR HR THEN LPRINT SD;1;"00,10,28,44,7C,44,44,00[2]00,38,44,04,38,40,7C,00[3]00,7C,04,18,04,44,38,00[4]00,08,18,28,48,7C,08,00[5]00,7C,40,78,04,44,38,00[6]00,38,40,78,44,44,38,00[7]00,7C,04,08,10,20,20,00[8]00,38,44,38,44,44,38,00[9]00,38,44,44,3C,04,38,00[T]00,46,C9,49,49,49,E6,00[J]00,1C,08,08,48,48,30,00[Q]00,38,44,44,54,48,34,00[K]00,44,48,70,50,48,44,00" 9022 IF USR HR THEN LPRINT SD;14,"00,22,22,3E,22,14,08,00[2]00,3E,02,1C,20,22,1C,00[3]00,1C,22,10,18,20,3E,00[4]00,10,3E,12,14,18,10,00[5]00,1C,22,20,1E,02,3E,00[6]00,1C,22,22,1E,02,1C,00[7]00,04,04,08,10,20,3E,00[8]00,1C,22,22,1C,22,1C,00[9]00,1C,20,3C,22,22,1C,00[T]00,67,92,92,92,93,62,00[J]00,0C,12,12,10,10,38,00[Q]00,2C,12,2A,22,22,1C,00[K]00,22,12,0A,0E,12,22,00" 9050 GOTO 2000 9100 REM [F][-][S][A][V][E] 9105 FAST 9115 POKE 32600,N1 9120 IF USR HR THEN SAVE "BLACKJACK",P 9130 IF PEEK 32600=N1 THEN IF USR HR THEN SAVE "DATA",S 9140 IF USR HR THEN CLEAR 9150 IF PEEK 32600=N0 THEN IF USR HR THEN LOAD "DATA",S 9160 GOTO VAL "2120" 16000 REM ## GOSUB # ##INKEY$ ```