DECUSNO.
TITLE
AUTHOR
COMPANY
DATE
SOURCE LANGUAGE
F~ROGRAM
11-5
BLACKJACK FOR FOCAl-11
Rick Merrill
Digital Equipment Corporation Maynard, Massachusetts
January 1, 1971
FOCAL
AI though this program has been tested by the contributor, no warranty, express or impl ied, is made by. the contributor, Digital Equipment Computer Users Society or Digital Equipment Corporation as to the accuracy or functioning of the program or related program material, and no responsibility is assumed by these parties in connection therewith.
BLACKJACK FOR FOCAL-11
DECU5 No. 11-5
AB5TRACT
This program deals random Blackjack hands to itself (the dealer) and the user (the player).
Hit "Y" if you want a hit, "N" if not. Utility functions are provided to deal and print card values.
C:FOCAL-11, TE5T
5~.~5 T ~ "WELCOME TO BLACKJACK~ "~
5~.1~ E 5~.~ 5 H=5
5~.3~ T ~ ~ II PLAYER DEALER"~
5~.4~ 5 Z=FNEW(FNEW(6,52},53)
5~.5~ 5 Z=FNEW(1,52};T II XXX"~;D 5~.4 5~.55 5 Z=? ?FNEW(FNEW(1,52},53}
5~.6~ 5 A=FNEW(6,51}
5~.7~ I (FNEW(1 ,51)}5~.76,5~.75,5~.8~
5~.75 T "DEALER WIN5~ XXX WA5 ";5 Z=FNEW(C(1},53};G 5~.1 5~.76 I (A}5~.75,5~.85,5~.85
5~.8~ I (A}5~.75,5~.85,5~.9~
5~.85 T "PLAYER WIN5~ II~; G 5~.1
5~.9~ A "HIT? ";5 A=FCHR(-1)-192-~Y;T ~;I (A}5~.92;D 5~.4 5~. 92 I (FNEW(1 ,51}-18}5~.55; I (A)5~. 94;G 5~.6
5~.94 I (FNEW(1 ,51}-FNEW(6,51»5,ei.85;G 5~.75 51 .~5 C-5CORE COUNT INDEX
51.1~ 5 &1=~; 5 &2=~; 5 Z.&-1
51.~ 5 Z=Z+1;1 (Z-&-5}51.3;1 (&1-22}51.5;5 &=-1;R 51 .3~ I (C(Z»8,51.2;5 &2=&2+1
51.35 I (C(Z}-37}51.37;5 &1=&1+1~;G 51.2 51.37 5 &1=&1+ 1+ FITR«C(Z}-1}/4>;G 51.2 51.5~ I (&2-5}51.6;G 51.7
51.6~ 5 Z=Z-1;1 (Z-&}51.8;
51.61 I (FITR«C(Z}-1}/4>}51.6,51.62,51.6 51.62 I (&1-11}51.6,51.7,51.6
51.7~ 5 &=~;R 51 .8~ 5 &=&1;R
52.~5 C-DEAL
52.1~ 5 Z=FITR(53*(FRAN( »);IF (Z)8,52.1;
52.211 5 &1=1
52.3~ I (Z-C(&1»52.4,52.1;
52.4~ 5 &1=&1+1;1 (&I-H)52.3;
52.5~ 5 &1=&
52.6~ I (C(&1»8,52.7;5 &1=&I+I;G 52.6 52.7~ 5 C(&I)=Z;5 &=Z
53.~1 5 Z=53.11+FITR«&-I)/4)/I~~;D ZiT .. OF
53.~2 5 Z=53.24t
r
&-FITR«&-I>/4)*4,:,,1 :J/l~~iD ZiT !iR 53.11 T "ACE53.12 T "DEUCE 53.13 T "THREE 53.14 T "FOUR 53.15 T "FIVE 53.16 T "51X 53.17 T "5EVEN 53.18 T "H~HT
53.19 T "I\.INE 53.211 T "TEN 53.21 T "JACK 53.22 T "QUEEN 53.23 T "KING 53.24 T "CLUB5 53.25 T "DIAMOND5 53.26 T "HEART5 53.27 T "5PADE5
2