d *** Original game programming by: Hughes J. Glantzberg ***nx ========================= BLACKJACK ===============================' This program plays Blackjack with either one or two players. Then computer always plays the role of dealer and the players betting on the results of each play. ======================== MAIN ROUTINE =============================' This routine contains the main logic for the program. It makese extensive use of subroutines which are described later.k:Get vector for STALK program.PROG.NAME$"STALK.EXE" : : ,: AZ I  : I,"":NUMWORDS: 5 A(@),NAM$(),BANK(),WORD$(NUMWORDS):BANK()_" P:B:O:CC:LIMIT:: ,,,HEART:DIAMOND:CLUB:SPADE6 I NUMWORDS: WORD$(I):@INIT: INIT:SPEAKJSP:LL:T$"TALKING BLACKJACK":  TT$"presented by":  ^T$"":  3hT$"COVOX, INC.":  VrT$"675 - D Conger St.":  z|T$"Eugene, OR 97402":  LL:T$"Press a key to continue":  : dSP:LL:T$"TALKING BLACKJACK":  : "" T$"pre sented by":  : "" 1T$"":  : "" eT$"COH VOX, INCORPORATED":  : "" T$"6 7 5 - Deee Cawnger Street":  : "" T$"Eugene, Oregon 9 7 4 0 2":  : "" LL:   I  : "" Ic: 1Y:X:CARDI:SUITHEART: h XY:X):CARDI:SUITSPADE: h ` IY:X:CARD :SUITHEART: h Y:X):CARD:SUITSPADE: @ SP:T$WORD$(): SPEAK(T$)CL$"\"(N, )"\"&IE$()()()( )(0 I ~:IE$IE$(I):C:DES$()" "()D======================== PLAY BLACKJACK =============================N:  , ,:"Will there be 1 or 2 players? (Enter H for help) ";$XST$"WILL THERE BEE 1 OR 2 <>. ENTER H FOR HELP": SPEAK(ST$)Yb :PLAYERS("~12Hh",IKEY$): PLAYERS blPLAYERSPLAYERS: PLAYERS v,v,Z ,Z v I PLAYERS:T$"Enter the name of player "(I)" ":W :TL(T$)ST$"ENTER THE NAME OF PLAYER "(I)7MAXLENNWTL:T$T$"\"(MAXLEN, )"\"Z I,W,: T$;(MAXLEN, );| I,WTL: SPEAK(ST$): L(IN$): L  ,,:::"EVERYONES got a name, what's yours?"ST$"<> GOT A NAME, WHAT'S YOURS?" SPEAK(ST$): 9SP:T$IN$:  :NAM$(I)T$k ,,:ST$"HELL<> "T$".": SPEAK(ST$)T$"How much does "NAM$(I)" have to bet? ":W :TL(T$)ST$"HOW MUCH DOES "NAM$(I)" HAVE TO BET?"MAXLEN:T$T$"\"(MAXLEN, )"\")  I,W,: T$;(MAXLEN, );V I,WTL: SPEAK(ST$): :A!(IN$)j  A!' H*E$"$"(A!)", That's more than I am worth! A number less than 10000, please?"4ST$"$"(A!)", THAT'S MORE THAN I AM WORTH. A NUMBER LESS THAN 10000, PLEASE."E> ,,:WA:  : SPEAK(ST$):  : VH A! pRE$"Please enter a number from 1 to 10000, OK?"\ST$"PLEASE ENTER A NUMBER FROM 1 TO 10000, O K ?"f ,,:WA:  : SPEAK(ST$):  : pBANK(I)A!z I:Z2:BR0 X 4:A(X)X: XD: :: ========================== SHUFFLING ================================  ,#,:"Shuffling..."ST$"SHUVF ULLING": SPEAK(ST$) L :X(4):Y(4)  A(X),A(Y): L:J&   ,#: ), w ======================== SELECT THE CARD ============================ SUIT((A(J)) ) CARDA(J)SUIT  SUIT SUITCLUB  SUIT SUITSPADE  SUIT SUITDIAMOND!$ SUIT SUITHEART!.`!8======================== SET UP THE CARD ============================q!BX(N) !LY(M)!V @ !` M N t!jT$WORD$((CARD))WORD$(SUIT ): SPEAK(T$)!t ,,:,"~========================= BEGIN THE GAME ============================E"BR: X PLAYERSn"E$"Press `E' to quit playing":  " BANK(X) "" ";" ,,: NAM$(X)" is broke!".#ST$NAM$(X)" IS <>": SPEAK(ST$)F#BRBR:  : #T$NAM$(X)"_, what is your bet? _$":W:TL(T$)#ST$NAM$(X)", WHAT IS YOUR <>."#MAXLEN:T$T$"\"(MAXLEN, )"\"#  X,W,: T$;(MAXLEN, );$  X,WTL: SPEAK(ST$): L$ IN$"E" IN$"e" EW: | : EWm$ A!(IN$): A!LIMIT 2$E$"The house limit is "(LIMIT)$ST$"THE HOWSE LIMIT IS, $"(LIMIT)$( ,,:  : SPEAK(ST$):  : $2 A! Z9%<E$"I'm sorry, negative and zero bets are not allowed."j%FST$"<><><>"%P ,,:  : SPEAK(ST$):  : %Z A!BANK(X) %dE$"You only have "(BANK(X))" in the bank"&nST$"<>, <>, NO <>">&x ,,:  : SPEAK(ST$):  : L&BET(X)A!i& X:: BRPLAYERS "s& v&X1:X2: R & A(;)  : "& X PLAYERS: ,: O);' ,,: NAM$(X)", insurance (Y or N)? ";K'ST$NAM$(X)", <><><> YES OR NO": SPEAK(ST$)o' : ("YNyn",IKEY$) ' X (IKEY$"y" IKEY$"Y") X1' X (IKEY$"y" IKEY$"Y") X2' X' A(;) (HJ:J:N:M: : 8: ,A:"BLACKJACK";=(JH:ST$WORD$(): SPEAK(ST$)G( Ha(" M  PLAYERSi(,N(6 BANK() ,A: (NAM$(),);(@ BANK()  ,A: (NAM$(),);(J ,A:"Dealer";)T BANK(M) ,: F): ,: NAM$(M); : Q)^ ,,:"'s turn - 1=HIT, 2=STAND, E=END -- Your choice? ";{)hST$"YOU'RE UP "NAM$(M): SPEAK(ST$))r :VV("12Ee",IKEY$):X(IKEY$):Q8M)| VV r,,,|,|) M: * * : 8:JJ: CARD R : RCARD* CARD R/*A(Q)A(Q)RN* A(Q) A(Q) u* A(Q)((A(Q))) *NN: Oc O:  : T* ,,: O): ,:"You're BUSTED";*ST$"YOU'RE <><>": SPEAK(ST$): ,,+BB: d/+ N A(Q) A(Q)(#=+TJ: h+ N T : Oc:T(L)T(L): + ,: O);: ,,:"No Blackjack";+ST$"NO BLACKJACK": SPEAK(ST$)+ d+& X1 BET()BET(),0 X2 BET()BET(),: "Z,D======================== ERROR ROUTINE ==============================},N IF ERR=4 THEN RESTORE:RESUME,X ,,b"error " " occurred in line " ,l,v======================= DISPLAY THE CARDS =========================== -: ,,- N 3- M  PLAYERSO- BANK(M) M - M0,,:"BROKE!";:ST$"<>": SPEAK(ST$): - M N  : - M,N: ,,:- : 8:JJ- CARD R : RCARD. CARD R$.A(8M)A(8M)R*.b.KJ: :A()A(J):JJ: CARD R : RCARD{.CARD: R R.  8.A(;)R. .* == PLAY THE DEALER ==.4 BPLAYERSBR .>N:M:WJ:J: : 8:JW/HVA(;):N&/RWV:VVW:X: W X7/\ V d/f X V  V  VV : /p : 8:JJ: CARD R : RCARD/zVVRW:NN: R/ X PLAYERS:UA(8X):YU:UUY 0 Y U  UU : U U0 V V.0Y(X)G0 A(8X)(# 0 Y,A:"BLACKJACK";:BANK(X)BANK(X)BET(X):T$WORD$(): SPEAK(T$)0 Y T$WORD$(): SPEAK(T$): 0 BANK(X) 1 VU Y,A:"PUSH ";:ST$"PUSH": SPEAK(ST$)k1 VU Y,A:"LOSE ";:ST$WORD$(): SPEAK(ST$):BANK(X)BANK(X)BET(X)1 VU Y,A:"WIN ";:BANK(X)BANK(X)BET(X):ST$WORD$()NAM$(X): SPEAK(ST$)1 X1 X7 ;:A(X): X:B1 d2 : ,%,:"SO FAR"72 ST$"SO FAR": SPEAK(ST$):XW2$ : I PLAYERS: ,,2. "\ \ has $##,###.##";NAM$(I),BANK(I)28 ST$NAM$(I)" HAS $"(BANK(I)): SPEAK(ST$):2B Q: I PLAYERS: BANK(I)0u ` '3L ,,::: NAM$(I)" has broken the bank!"m3V ST$NAM$(I)" HAS <> THE <>": SPEAK(ST$):Q3` : Q "3j J* 3t ~3~ : ,: :3 Centering routine3 LL:  3 ((LL))4 L(T$): LL2 L2L4 ,((L): T$/4 SP  54 J4 Border routinet4 Y((LL)):X((OL2))4 CC,: Y,X: (L2,)4 I LL: ,X: ();(L2,);():4 ,X: (L2,)4 ,:#5 Convert a string to uppercase for the smooth talker.D5 LL(T$):B$"": LL F z5 JJ LL:T1$(T$,JJ,):R(T1$):Q(R )5( Q@ Q[ B$B$(Q)52 (R/ R:) R B$B$T1$5< :T$B$: SP SPEAK(T$)5F 5P Help section.6Z D6d " This is a Public Domain Black Jack program converted by"6n "programmers at Covox to use Smooth Talker for output VIA Speech Thing."6x "Both items available through Covox Inc."7 :"Smooth Talker is not perfect, so I will rewrite this text"27 "the way Smooth Talker likes to see it.":7 :7 T$" THIS IS A PUBLIC DOH MAIN BLACK JACK PROGRAM CONVERTED BY": T$: SPEAK(T$)8 T$"PROGRAMMERS AT COH VOX TO USE SMOOTH TALKER FOR OUTPUT VIA SPEECH THING": T$: SPEAK(T$)X8 T$"BOTH ITEMS AVAILABLE THROUGH COH VOX IN KORPORATED.": T$:: SPEAK(T$)8 T$"SMOOTH TALKER IS NOT PURR FFECT, SO I WILL RE WRITE THIS TEXT": T$: SPEAK(T$)8 T$"TTHUH WAYE SMOOTH TALKER LIKES TO SSEE IT.": T$: SPEAK(T$)09 LL:T$"Press a key to continue":  : d:9 NW9 Windowed error routine9 ,,:" ";9 ,,: E$;9 9 ,!:"Press a key...";: ST$"PRESS A KEY": SPEAK(ST$): ,,B:" : ,!:" ";:, ,,:" ";:6 :@ ======================== DISPLAY A CARD ============================2;J This routine displays a card at coordinates (y,x) on theu;T screen. CARD must be set to the card number (1-13) and SUIT;^ must be set to the value of the suit of the card.;h Y,X,: () (,) (); Y,X: () " " (SUIT) " " ();P> Y,X: () " " ();w> Y,X: () " A" ();}> > ========================= DISPLAY A 2 =============================>& Y,X: () "2 " (); ?0 Y,X: () " " (SUIT) " " ();G?: Y,X: () " " ();y?D Y,X: () " " (SUIT) " " ();?N Y,X: () " 2" ();?X ?b ========================= DISPLAY A 3 =============================@l Y,X: () "3 " ();I@v Y,X: () " " (SUIT) " " ();{@ Y,X: () " " (SUIT) " " ();@ Y,X: () " " (SUIT) " " ();@ Y,X: () " 3" ();@ $A ========================= DISPLAY A 4 =============================KA Y,X: () "4 " ();A Y,X: () " " (SUIT) " " (SUIT) " " ();A Y,X: () " " ();A Y,X: () " " (SUIT) " " (SUIT) " " ();B Y,X: () " 4" ();B cB ========================= DISPLAY A 5 =============================B Y,X: () "5 " ();B Y,X: () " " (SUIT) " " (SUIT) " " ();B Y,X: () " " (SUIT) " " ();6C Y,X: () " " (SUIT) " " (SUIT) " " ();]C Y,X: () " 5" ();cC* C4 ========================= DISPLAY A 6 =============================C> Y,X: () "6 " ();DH Y,X: () " " (SUIT) " " (SUIT) " " ();NDR Y,X: () " " (SUIT) " " (SUIT) " " ();D\ Y,X: () " " (SUIT) " " (SUIT) " " ();Df Y,X: () " 6" ();Dp Ez ========================= DISPLAY A 7 =============================)E Y,X: () "7 " ();ZE Y,X: () " " (,SUIT) " " ();E Y,X: () " " (SUIT) " " ();E Y,X: () " " (,SUIT) " " ();E Y,X: () " 7" ();E 4F ========================= DISPLAY A 8 =============================[F Y,X: () "8 " ();F Y,X: () " " (,SUIT) " " ();F Y,X: () " " (SUIT) " " (SUIT) " " ();F Y,X: () " " (,SUIT) " " ();!G Y,X: () " 8" ();'G qG========================= DISPLAY A 9 =============================G Y,X: () "9 " ();G Y,X: () " " (,SUIT) " " ();G$ Y,X: () " " (,SUIT) " " ();+H. Y,X: () " " (,SUIT) " " ();QH8 Y,X: () " 9" ()WHBHL========================= DISPLAY A 10 =============================HV Y,X: () "10 " ();I` Y,X: () " " (,SUIT) " " (,SUIT) " " ();6Ij Y,X: () " " (,SUIT) " " ();gIt Y,X: () " " (,SUIT) " " ();I~ Y,X: () " 10" ();II========================= DISPLAY A J =============================J Y,X: () "J " ();7J Y,X: () " " (SUIT) " " ();^J Y,X: () " " ();J Y,X: () " " (SUIT) " " ();J Y,X: () " J" ();JK========================= DISPLAY A Q =============================.K Y,X: () "Q " ();`K Y,X: () " " (SUIT) " " ();K Y,X: () " " ();K Y,X: () " " (SUIT) " " ();K  Y,X: () " Q" ();K0L========================= DISPLAY A K =============================WL( Y,X: () "K " ();L2 Y,X: () " " (SUIT) " " ();L< Y,X: () " " ();LF Y,X: () " " (SUIT) " " (); MP Y,X: () " K" ();MZMdT!-Mn T! JMxIKEY$: IKEY$"" nPMZM ,,|MIKEY$: IKEY$""  : M New input routine.MCY:CX(X):IN$"":IL: ,,MK$:IV(IE$,K$): IV M IV N IV ,,N ILMAXLEN ?NIN$IN$K$:ILIL: K$;: PN IL aN IL NILIL:IN$(IN$,IL): DES$;: N CY,CX: (MAXLEN, );: CY,CX: NN --- Secondary exit routine ---O":"Do you wish to play again?";O,ST$"doo yu wish to play uh<<~7gEHn>>": SPEAK(ST$)RO6VV("YyNn",IKEY$)sO@ VV J,N,N,,OJ:"Please enter Y or N"OTST$"PLEASE ENTER Y OR N": SPEAK(ST$)O^ :VV("~Yy",IKEY$)Oh VV  : NPr Exit routine-P|E$"Do you really want to exit?":  aPST$"DO YOU REALLY WANT TO EKZIT?": SPEAK(ST$)}P :VV("~Yy",IKEY$)P VV P" ";P EW  : TQ ,:: ,,BQ::"Thank you for playing, goodbye now."|QST$"THANK U FOR PLAYING, GOOD BIE NOW.": SPEAK(ST$)QQ "AYZZ","2","3","4","5","6","7","8","9","10"Q "<>","<>"R "<>","<>","<>";R "<>","<>"R "<><><>","YOU <>","BLACK JACK"R: ******************************************************************S: * FINDER.BAS - vector finder subroutine *aS: * This is a subroutine that will find the interrupt vector of *S: * the COVOX TSR program that is specified in the string variable *S: * PROG.NAME$. After MERGING this subroutine with the main BASIC *BT: * program, call it by simply executing a GOSUB 65000. See your *T: * "User Manual" for complete details. *T: ******************************************************************T:U::"One moment please..."GU: On Entry PROG.NAME$ = Name of the COVOX program to search for.OU:U: Convert any lower case letters of the program name to upper case.U C (PROG.NAME$)UL((PROG.NAME$,C,))U L` LL :(PROG.NAME$,C,)(L)V CV:V:[V: Search vectors 64 through 127 for the COVOX program address.V VECTOR(@ ) ( ) V SEG:: Set to segment zero in order to access vector table.V:W: Get the segment & offset values for the vector.