-
Notifications
You must be signed in to change notification settings - Fork 0
/
freebj.1
272 lines (215 loc) · 6.97 KB
/
freebj.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
.TH freebj 1 "10 February 2021"
.SH NAME
freebj \- Blackjack strategy simulator
.SH SYNOPSIS
.B freebj [OPTION...]
.SH DESCRIPTION
Simulate Blackjack games given a playing strategy and a set of rules. FreeBJ is
used to optimize and test game strategies typically using card counting.
FreeBJ is able to count cards using the hi-lo system and adapt its bet based on
a programmable betting strategy. The simulator also supports playing deviations
and one can dynamically add their own deviations.
FreeBJ is a command-line interface program that prints on its standard output a
JSON of all the statistics gathered; the program can also output on demande a
CSV of bankroll samples to have a look on the evolution of your capital
throughout the playing session.
.SH OPTIONS
.TP
\fB-a\fR \fIACTION\fR
Always play ACTION as the first action on each hand, bypassing strategies.
Possible actions: +: hit; =: stand; D: double; V: split; #: surrender.
.TP
\fB--ahc\fR
Use the American holecard game rule.
.TP
\fB-b\fR, \fB--bet\fR \fIBET\fR
Specify the base bet; with card counting, this is the bet placed with a true
count of zero.
.TP
\fB--bet-max-tc\fR \fITC\fR
The maximum true count value to take into account for the betting strategy,
TC above won't increase the bet.
.TP
\fB--bet-neg-tc\fR \fINEG_BET\fR
The bet to place when true count is zero or negative.
.TP
\fB--bet-per-tc\fR \fIBET_PER_TC\fR
The amount to increase the bet with for each point of true count.
.TP
\fB-c\fR \fICARD,CARD[,CARD...]\fR
Set the cards each player will start with separated by commas, there must be at
least two cards.
.TP
\fB-D\fR, \fB--add-deviation\fR \fIDEVIATION\fR...
Add a new basic strategy deviation using the \fIDEVIATION\fR directive; its
syntax is \fI"<HAND>vs<DEALER>:('<'|'>')<TC><ACTION>"\fR, \fIHAND\fR can
represent a hard total ("18"), a soft total ("A7"), or a pair
("8/8", "A/A", "T/T", ...); \fIDEALER\fR is the dealer's upcard (number or "A");
\fITC\fR is the true count above/equal ('>') or under/equal ('<') which to apply
the \fIACTION\fR deviation.
Possible actions: +: hit; =: stand; D: double; V: split; S: surrender.
This option can be repeated to add more deviations; if \fB--deviations\fR is
given, this will override default playing deviations.
Example: "16vs10:>+1=" (stand at TC 1 or above with a hard 16 against a dealer 10).
.TP
\fB-d\fR \fIDECKS\fR
The number of card decks to play.
Default: 6.
.TP
\fB--das\fR
Allow doubling down on split hands (double after split - DAS).
.TP
\fB--db-any\fR
Allow doubling down on any hand regardless of the number of cards.
.TP
\fB--db-any2\fR
Allow doubling down on any hand on the first two cards only.
.TP
\fB--db-hard-10-11\fR
Allow doubling down on hard hands with a total of 10 or 11 on the first two
cards only.
.TP
\fB--db-hard-9-11\fR
Allow doubling down on hard hands with a total of 9, 10, or 11 on the first two
cards only.
.TP
\fB--db-none\fR
Disallow doubling down on all hands.
.TP
\fB--dealer\fR \fICARD[,CARD...]\fR
Set the cards the dealer will start with separated by commas.
Example: A.
.TP
\fB--deviations\fR
Enable playing deviations, this requires card counting.
.TP
\fB--dry-run\fR
Do not perform any actual work; useful to extract simulation meta information
such as game rules.
.TP
\fB--enhc\fR
Use the European no-holecard game rule.
.TP
\fB--esurr\fR
Allow early surrender.
.TP
\fB--force-tc\fR \fITC\fR
Force a specific true count value in the shoe for each round run; this requires
reshuffling the shoe before each round and remove random cards to achieve the
desired true count, causing some performance penalties.
.TP
\fB-h\fR, \fB--help\fR
Print help information.
.TP
\fB--h17\fR
Hit on dealer soft 17 (H17).
.TP
\fB--hilo\fR
Count cards using hilo system, this will adapt the betting strategy but won't
enable playing deviations.
.TP
\fB--holecarding\fR
Use holecarding strategy where the dealer's holecard is known to the players.
Requires \fB--ahc\fR.
.TP
\fB-j\fR \fIJOBS\fR
The number of processing jobs, should be equal to the number of CPUs.
.TP
\fB--lsurr\fR
Allow late surrender.
.TP
\fB--max-splits\fR \fIMAX_SPLITS\fR
The maximum number of hands a player can get from splitting.
Default: 4.
.TP
\fB-n\fR \fIROUNDS\fR
The number of game rounds to simulate. Accepts 'k', 'M', and 'G' suffixes.
.TP
\fB--no-das\fR
Disallow doubling down on split hands (double after split - DAS).
.TP
\fB--no-playAA\fR
Disallow the player to play their hand after splitting aces, the split hands
will receive only one card and then closed.
.TP
\fB--no-surr\fR
Disallow any form of surrender.
.TP
\fB-p\fR \fIPENETRATION\fR
Set the penetration ratio, i.e. the proportion of cards to deal from the shoe
before shuffling. Can be represented as a percentage (e.g. "80%" for 4/5
penetration), or as a number of card decks (e.g. "3d"), or a number of cards to
deal (e.g. "100"), or a ratio (e.g. "5/6").
Default: "80%".
Example: "100M".
.TP
\fB--playAA\fR
Allow the player to play their hand after splitting aces.
.TP
\fB--s17\fR
Stand on dealer soft 17 (S17).
.TP
\fB--shoe-file\fR \fISHOE_FILE\fR
Provide a binary file of cards to load into the card shoe. The file contains
bytes from 1 to 10 included.
Example: "8,A,10".
.TP
\fB-V\fR, \fB--version\fR
Print version information.
.TP
\fB-v\fR
Print verbose details on each round.
.SH JSON OUTPUT
When finished, FreeBJ prints to its standard output (fd 1) a JSON document of
the simulation's statistics including the expected value (EV) and standard
deviation.
.TP
\fBrules\fR
The game rules used for the simulation.
.RS 8
.TP
\fBgame_type\fR
(str) \fIahc\fR for American holecard game, \fIenhc\fR for European no-holecard game.
.TP
\fBsoft17\fR
(str) \fIs17\fR for stand on dealer soft 17, \fIh17\fR for hit dealer soft 17.
.TP
\fBdas\fR
(bool) Whether to allow double-down after split or not.
.TP
\fBbj_pays\fR
(float) How much a player's Blackjack pays for a bet of 1.0.
.TP
\fBdouble_down\fR
(str) The doubling-down policy: \fIno_double\fR always disallow double-down;
\fIany_hand\fR always allow double-down even with more than two cards;
\fIany_two\fR allow double-down on any hand with two cards; \fIhard_9_to_11\fR
allow double-down only on hard hands with two cards and a total from 9 to 11
included; \fIhard_10_to_11\fR allow double-down only on hard hands with two
cards and a total from 10 to 11 included.
.TP
\fBsurrender\fR
(str) \fIno_surrender\fR: surrendering is disallowed; \fIearly_surrender\fR:
early surrendering is allowed; \fIlate_surrender\fR: late surrendering is
allowed.
.TP
\fBplay_ace_pairs\fR
(bool) Whether to allow the player to play a hand resulting from the splitting
of a pair of aces.
.TP
\fBmax_splits\fR
(int) The maximum number of hands a player can have from splitting pairs; 1
means no splitting is allowed.
.TP
\fBdecks\fR
(int) The number of card decks used.
.TP
\fBpenetration_cards\fR
(int) The number of cards actually played from the shoe before reshuffling.
.RE
.TP
\fBev\fR
(float) The expected value, the average win or loss per round.
.TP
\fBstddev\fR
(float) The standard deviation of the rounds' wins and losses.