No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

3789 líneas
73KB

  1. \input texinfo @c -*-texinfo-*-
  2. @c %**start of header
  3. @documentencoding UTF-8
  4. @setfilename blackjack.info
  5. @set UPDATED December 20, 2020
  6. @set VERSION v0.2.5-g9c5893b
  7. @copying
  8. This manual is for LibreBlackjack (version @value{VERSION}, @value{UPDATED}),
  9. which is a completely free-as-in-freedom blackjack engine designed to
  10. study and analyze the game statistics using different playing strategies
  11. ranging from simple card counting up to other complex algorithms based
  12. on artificial intelligence..
  13. Copyright @copyright{} 2016-2020 Jeremy Theler.
  14. @quotation
  15. Permission is granted to copy, distribute and/or modify this document
  16. under the terms of the GNU Free Documentation License, Version 1.3 or
  17. any later version published by the Free Software Foundation; with no
  18. Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
  19. Texts. A copy of the license is included in the section entitled
  20. ``GNU Free Documentation License''.
  21. @end quotation
  22. @end copying
  23. @ifnottex
  24. @paragraphindent 0
  25. @end ifnottex
  26. @titlepage
  27. @title Libre@ Blackjack
  28. @subtitle A free blackjack back end, v0.2.5-g9c5893b
  29. @author Jeremy Theler
  30. December 20, 2020
  31. @page
  32. @vskip 0pt plus 1filll
  33. @insertcopying
  34. @end titlepage
  35. @contents
  36. @node Top
  37. @top Libre@ Blackjack
  38. @menu
  39. * Overview::
  40. * Running blackjack::
  41. * Commands::
  42. * Configuration file::
  43. * Example automated players::
  44. @end menu
  45. @node Overview
  46. @chapter Overview
  47. @anchor{#overview}
  48. Libre@ Blackjack is a blackjack engine that emulates a dealer, deals
  49. (digital) cards and understands plain-text commands such as @code{hit}
  50. or @code{stand}. It's inspired by GNU@ Chess. The basic idea is that one
  51. or more players can talk to Libre@ Blackjack either in an interactive or
  52. in an automated way through
  53. @itemize
  54. @item
  55. the standard input/output (optionally using named pipes or TCP
  56. (web)sockets with @code{netcat} or @code{gwsocket}), or
  57. @item
  58. C++ methods (optionally loaded at runtime from shared objects---TBD).
  59. @end itemize
  60. These players can be actual human players playing in real-time through a
  61. front end (a GUI application, a web-based interface, a mobile app, etc.)
  62. or robots that implement a certain betting and playing strategy playing
  63. (i.e.@ card counting) as fast as possible to study and analyze game
  64. statistics. There is an internal player that reads the strategy from a
  65. text file and plays accordingly. Libre@ Blackjack can also be used to
  66. play interactive ASCII blackjack.
  67. @menu
  68. * Background::
  69. * A note on the C++ implementation::
  70. @end menu
  71. @node Background
  72. @section Background
  73. @anchor{#background}
  74. The casino game known as Blackjack has converged to the current
  75. mainstream rules since the beginning of the 20th century. Assuming the
  76. cards are infinite, the best strategy for the player yields
  77. approximately a house edge which is in the order of@ 0.5%. This is a
  78. remarkable result, because the rules of the game are not trivial and the
  79. overall combination gives a very little margin for the dealer, more than
  80. five times smaller than standard single-zero roulette. In 1963, Edward
  81. Thorp published his seminal book @emph{Beat the dealer} where he
  82. showed---with the help of the mainframes available at that time---that
  83. it is possible to flip the margin to the player's side by taking into
  84. account that the chances of dealing the next card of a finite shoe
  85. depends on the cards that were already dealt. This was the beginning of
  86. the card counting era, and a lot of mathematicians have devoted to the
  87. analysis of probabilities in the Blackjack game---and its variations.
  88. @quotation
  89. ``I am often surprised that when people drive down two-lane roads, they
  90. will trust complete strangers in the oncoming lane not to swerve into
  91. their lane causing a head-on collision; but they will not trust
  92. mathematicians to create the correct strategy for Blackjack.''
  93. Norman Wattenberger, Modern Blackjack, 2009
  94. @end quotation
  95. With Libre@ Blackjack you do not have to trust other people anymore. You
  96. have a free blackjack engine which you can
  97. @enumerate 0
  98. @item
  99. run as you wish, to see the results of billions of blackjack hands,
  100. @item
  101. study to see how it works and change it if you do not like it,
  102. @item
  103. share it with your friends and colleagues, and
  104. @item
  105. distribute copies of your modified versions.
  106. @end enumerate
  107. If you do not know how to program, you have the @emph{freedom} to hire a
  108. programmer to do it for you. That is why Libre@ Blackjack is @emph{free
  109. software}.
  110. Once you trust the blackjack engine is fair, you can model and simulate
  111. any blackjack situation you want, playing millions of times a certain
  112. hand (say a sixteen against a ten) in different ways (say hitting or
  113. standing) with different rules (does the dealer have to hit soft
  114. seventeens?) to obtain you own conclusions. You can even build the basic
  115. strategy charts from scratch to convince yourself there is no ``flaw.''
  116. The main objective is research and optimization of playing and betting
  117. strategies depending on
  118. @itemize
  119. @item
  120. particular table rules (number of decks, hit on soft 17, double after
  121. split, etc.),
  122. @item
  123. card counting strategies
  124. @item
  125. risk of ruin
  126. @item
  127. removal of cards
  128. @item
  129. arranged shoes
  130. @end itemize
  131. These automatic players can range from simple no-bust or
  132. mimic-the-dealer hitters or standers, up to neural-networks trained
  133. players taking into account every card being dealt passing through basic
  134. strategy modified by traditional card counting mechanisms.
  135. @node A note on the C++ implementation
  136. @section A note on the C++ implementation
  137. @anchor{#a-note-on-the-c-implementation}
  138. The first Libre@ Blackjack version (v0.1) was written in C. This version
  139. (v0.2) is a re-implementation of nearly the same functionality but
  140. written completely from scratch in C++. I am not a fan of C++ and still
  141. prefer old plain C for most of my programming projects, but for the
  142. particular case of Libre@ Blackjack these advantages of C++ over C ought
  143. to be noted:
  144. @itemize
  145. @item
  146. the inheritance mechanisms of C++ and virtual methods allows to have
  147. generic dealer and player classes from which particular games (dealers)
  148. and strategies (players) can be instantiated. This way, Blackjack
  149. variations like
  150. @itemize
  151. @item
  152. Spanish 21
  153. @item
  154. Down under Blackjack
  155. @item
  156. Free Bet Blackjack
  157. @item
  158. Blackjack Switch
  159. @end itemize
  160. or even the Spanish ``Siete y medio'' could be also implemented in the
  161. same framework (the card deck should also be changed though). But also
  162. playing variations like a dealer that exposes the hole card a certain
  163. amount of the time (say 1% or 2% of the hands) could also be studied by
  164. extending the base blackjack dealer class.
  165. @item
  166. the private members of the C++ classes allow information to be hidden
  167. between the dealer and the player, so a far better separation of
  168. information can be achieved. This also prevents ``cheating'' in players
  169. by looking at information which is not available for them (such as the
  170. dealer's hole card or the content of the shoe).
  171. @item
  172. the virtual members of derived players and even be linked to other
  173. high-level programming language parsers (such as Python or Julia)
  174. allowing to use the vast variety of AI/ML libraries available for these
  175. languages to implement advanced playing strategies.
  176. @item
  177. the usage of STL containers, methods and algorithms allows for a faster
  178. and cleaner implementation of cards, hands, decks and shoes.
  179. @end itemize
  180. @node Running blackjack
  181. @chapter Running @code{blackjack}
  182. @anchor{#running-blackjack}
  183. @menu
  184. * Invocation::
  185. * Interactive game::
  186. @end menu
  187. @node Invocation
  188. @section Invocation
  189. @anchor{#invocation}
  190. The format for running the @code{blackjack} program is:
  191. @verbatim
  192. blackjack [options] [path_to_conf_file]
  193. @end verbatim
  194. If no configuration file is given, a file named @code{blackjack.conf} in
  195. the current directory is used, provided it exists. With no options and
  196. no configuration file, @code{blackjack} starts in interactive mode and
  197. it is ready to start a blackjack game.
  198. The @code{blackjack} executable supports the following options:
  199. All the options which can be given in the configuration file can be
  200. passed as a command-line argument. For example, running
  201. @verbatim
  202. blackjack --decks=4 --no_insurance=true
  203. @end verbatim
  204. is equivalent to using a configuration file with
  205. @verbatim
  206. decks = 4
  207. no_insurance = true
  208. @end verbatim
  209. @node Interactive game
  210. @section Interactive game
  211. @anchor{#interactive-game}
  212. If @code{blackjack} is attached to an interactive TTY (i.e.@ neither the
  213. standard input nor outputs are redirected), an interactive game is
  214. triggered. First thing the program will do is to ask for a bet:
  215. @verbatim
  216. LibreBlackjack v0.2+Δ
  217. a free & open blackjack engine
  218. Starting new hand #1 with bankroll 0
  219. <-- Bet?
  220. >
  221. @end verbatim
  222. So the user should enter a number, say ``1'' and then press Enter and
  223. then a game will be dealt:
  224. @verbatim
  225. Player's card is Q♥
  226. Dealer's up card is 10♠
  227. Player's card is Q♣
  228. Dealer's hole card is dealt
  229. No blackjacks
  230. -- Dealer's hand: --------
  231. _____ _____
  232. |10 | |#####|
  233. | | |#####|
  234. | ♠ | |#####|
  235. | | |#####|
  236. |___10| |#####|
  237. Value: 10
  238. -- Player's hand --------
  239. _____ _____
  240. |Q | |Q |
  241. | | | |
  242. | ♥ | | ♣ |
  243. | | | |
  244. |____Q| |____Q|
  245. Value: 20
  246. <-- Play? 20 10
  247. >
  248. @end verbatim
  249. A flat-betting game can be played by passing @code{--flat_bet=true}
  250. through the command line.
  251. @node Commands
  252. @chapter Commands
  253. @anchor{#commands}
  254. The dealer (he) and the player (she) ``talk'' through commands, which
  255. are ASCII strings sent through any of the different IPC mechanisms
  256. discussed in [Automated playing through IPC]. In the most basic case, a
  257. human player reads commands from the dealer from @code{blackjack}'s
  258. standard output and writes her commands into the dealer's standard
  259. input. Those commands from the dealer that require a particular action
  260. from the player end with a quotation sign such as @code{bet?},
  261. @code{insurance?} or @code{play?}.
  262. All numerical values such as hand totals or bankrolls are given as
  263. decimal ASCII strings.
  264. @menu
  265. * From the dealer to the player::
  266. * From the player to the dealer::
  267. @end menu
  268. @node From the dealer to the player
  269. @section From the dealer to the player
  270. @anchor{#from-the-dealer-to-the-player}
  271. @node From the player to the dealer
  272. @section From the player to the dealer
  273. @anchor{#from-the-player-to-the-dealer}
  274. The following commands are available for the player for playing her
  275. hand.
  276. The following are general commands in the sense that they can be sent
  277. from the player to the dealer at any moment of the game.
  278. @node Configuration file
  279. @chapter Configuration file
  280. @anchor{#configuration-file}
  281. Libre@ Blackjacks reads a configuration file that contains
  282. @itemize
  283. @item
  284. settings about the rules of the game
  285. @itemize
  286. @item
  287. number of decks,
  288. @item
  289. whether if the dealer has to hit soft seventeen or not,
  290. @item
  291. blackjack payout,
  292. @item
  293. maximum bet allowed,
  294. @item
  295. etc@dots{}
  296. @end itemize
  297. @item
  298. how the player is supposed to play
  299. @itemize
  300. @item
  301. number of hands
  302. @item
  303. whether a flat or variable bet is going to be used,
  304. @item
  305. etc@dots{}
  306. @end itemize
  307. @item
  308. if there are any particular shoe arrangement, i.e.@ a predefined set of
  309. cards dealt in a certain order for instance to play one million hands of
  310. a sixteen against a dealer's ten
  311. @item
  312. what kind of information is shown in the interactive session
  313. @itemize
  314. @item
  315. if ASCII-art cards are supposed to be shown,
  316. @item
  317. a real-time delay to make the game smoother,
  318. @item
  319. etc.
  320. @end itemize
  321. @item
  322. how the automated player communicates with the dealer
  323. @itemize
  324. @item
  325. using standard input/output,
  326. @item
  327. FIFO named pipes,
  328. @item
  329. POSIX message queues,
  330. @item
  331. POSIX shared memory,
  332. @item
  333. etc@dots{}
  334. @end itemize
  335. @end itemize
  336. The location of the configuration file can be given in the command line.
  337. If none is provided, a file named @code{blackjack.conf} in the current
  338. directory is used. If such file does not exists, the defaults values of
  339. each variable are used. Individual variables can be set from the command
  340. line by passing one or more times the option
  341. @code{--}configuration_variable@code{[=}@emph{value}@code{]} in the
  342. @ref{#invocation,invocation}.
  343. Comments can be inserted using either a hash @code{#} or a colon
  344. @code{;}. The following configuration file is the default provided in
  345. the main distribution tarball:
  346. @verbatim
  347. # uncomment the following line to arrange cards
  348. # arranged_cards = 1 5 14 9 27
  349. flat_bet = 1 # do not ask for bets
  350. no_insurance = 1 # do not ask for insurance
  351. decks = 1 # number of decks, negative means infinite
  352. @end verbatim
  353. @menu
  354. * Variables and values::
  355. * Dumb internal player::
  356. @end menu
  357. @node Variables and values
  358. @section Variables and values
  359. @anchor{#variables-and-values}
  360. @node Dumb internal player
  361. @section Dumb internal player
  362. @anchor{#dumb-internal-player}
  363. @node Example automated players
  364. @chapter Example automated players
  365. @anchor{#example-automated-players}
  366. The directory @code{players} contains a few examples of automated
  367. player, which are discussed in the following sections. A script
  368. @code{check.sh} runs some of them and compares the expected value of the
  369. bankroll relative to the number of hands which each player obtains with
  370. the theoretical expected value (according to the game rules and player's
  371. strategy) within an allowed statistical uncertainty. This scripts writes
  372. the following table (actual values might vary depending on the random
  373. nature of the game):
  374. @multitable {Mimic the dealer} {Expected} {-0.0075415} {0.00926715} {Status}
  375. @headitem
  376. Case
  377. @tab Expected
  378. @tab Result
  379. @tab Error
  380. @tab Status
  381. @item
  382. Internal player
  383. @tab -0.0065
  384. @tab -0.0075415
  385. @tab 0.00348656
  386. @tab ok
  387. @item
  388. Always stand
  389. @tab -0.150
  390. @tab -0.15393
  391. @tab 0.00941969
  392. @tab ok
  393. @item
  394. No-bust strategy
  395. @tab -0.075
  396. @tab -0.077645
  397. @tab 0.00944109
  398. @tab ok
  399. @item
  400. Mimic the dealer
  401. @tab -0.055
  402. @tab -0.063785
  403. @tab 0.00926715
  404. @tab ok
  405. @end multitable
  406. The columns are
  407. @enumerate
  408. @item
  409. Case name, as discussed below.
  410. @item
  411. Expected theoretical result in absolute units (i.e.@ -0.01 means -1%)
  412. @item
  413. Actual result obtained by Libre@ Blackjack in absolute units
  414. @item
  415. Estimated error equal to the standard deviation of the result
  416. @item
  417. Whether the result coincides or not with the theoretical value
  418. @end enumerate
  419. @menu
  420. * Internal player::
  421. * Always stand::
  422. * No-bust strategy::
  423. * Mimic the dealer::
  424. * Derivation of the basic strategy::
  425. @end menu
  426. @node Internal player
  427. @section Internal player
  428. @anchor{#internal-player}
  429. If @code{blackjack} is called with the @code{-i} option, it uses an
  430. @emph{internal} player to play against itself. By default it plays basic
  431. strategy. Run
  432. @verbatim
  433. blackjack -i
  434. @end verbatim
  435. and you will get the following report with the results of playing one
  436. million hands with basic strategy.
  437. @verbatim
  438. result: "(-0.7 ± 0.3) %"
  439. mean: -0.006799
  440. error: 0.00348707
  441. hands: 1e+06
  442. bankroll: -6799
  443. bustsPlayer: 0.139358
  444. bustsDealer: 0.239722
  445. wins: 0.448034
  446. pushes: 0.085913
  447. losses: 0.495532
  448. @end verbatim
  449. @node Always stand
  450. @section Always stand
  451. @anchor{#always-stand}
  452. To play Blackjack as an ``always-stander'' run the following command:
  453. @verbatim
  454. yes stand | blackjack -n1e5 --flat_bet=true --no_insurance=true > /dev/null
  455. @end verbatim
  456. The UNIX command @code{yes stand} writes the string ``stand'' repeteadly
  457. to the standard output, which is piped to the executable
  458. @code{blackjack} (assumed to be installed system-wide). The arguments
  459. tell Libre@ Blackjack to play one hundred thousand hands (@code{-n1e5})
  460. using a flat bet (@code{flat_bet}, it defaults to a unit bet in each
  461. hand) and without asking for insurance if the dealer shows an ace
  462. (@code{no_insurance}). As there is no @code{blackjack.conf} file, the
  463. rules are---as expected---the default ones (see the documentation for
  464. details).
  465. The @code{/dev/null} part is important, otherwise Libre@ Blackjack will
  466. think that there is a human at the other side of the table and will
  467. @enumerate
  468. @item
  469. run slower (it will add explicit time delays to mimic an actual human
  470. dealer), and
  471. @item
  472. give all the details of the dealt hands in the terminal as ASCII
  473. (actually UTF-8) art
  474. @end enumerate
  475. This example is only one-way (i.e.@ the player ignores what the dealer
  476. says) so it is better to redirect the standard output to
  477. @code{/dev/null} to save execution time. The results are written as a
  478. @uref{http://yaml.org/,YAML}-formatted data to @code{stderr} by default
  479. once the hands are over, so they will show up in the terminal
  480. nevertheless. This format is human-friendly (far more than JSON) so it
  481. can be easily parsed, but it also allows complex objects to be
  482. represented (arrays, lists, etc.).
  483. @verbatim
  484. result: "(-15.8 ± 0.9) %"
  485. mean: -0.157675
  486. error: 0.00940803
  487. hands: 100000
  488. bankroll: -15767.5
  489. bustsPlayer: 0
  490. bustsDealer: 0.27344
  491. wins: 0.38585
  492. pushes: 0.04807
  493. losses: 0.56608
  494. @end verbatim
  495. @quotation
  496. @strong{Exercise:} verify that the analytical probability of getting a
  497. natural playing with a single deck (for both the dealer and the player)
  498. is 32/663 = 0.04826546@dots{}
  499. @end quotation
  500. @node No-bust strategy
  501. @section No-bust strategy
  502. @anchor{#no-bust-strategy}
  503. This directory shows how to play a ``no-bust'' strategy, i.e.@ not
  504. hitting any hand higher or equal to hard twelve with Libre@ Blackjack.
  505. The communication between the player and the back end is through
  506. standard input and output. The player reads from its standard input
  507. Libre@ Blackjack's commands and writes to its standard output the
  508. playing commands. In order to do this a FIFO (a.k.a. named pipe) is
  509. needed. So first, we create it (if it is not already created):
  510. @verbatim
  511. mkfifo fifo
  512. @end verbatim
  513. Then we execute @code{blackjack}, piping its output to the player (say
  514. @code{no-bust.pl}) and reading the standard input from @code{fifo},
  515. whilst at the same time we redirect the player's standard output to
  516. @code{fifo}:
  517. @verbatim
  518. rm -f fifo; mkfifo fifo
  519. blackjack -n1e5 < fifo | ./no-bust.pl > fifo
  520. @end verbatim
  521. As this time the player is coded in an interpreted langauge, it is far
  522. smarter than the previous @code{yes}-based player. So the player can
  523. handle bets and insurances, and there is not need to pass the options
  524. @code{--flat_bet} nor @code{--no_insurance} (though they can be passed
  525. anyway). Let us take a look at the Perl implementation:
  526. @verbatim
  527. ##!/usr/bin/perl
  528. ## this is needed to avoid deadlock with the fifo
  529. STDOUT->autoflush(1);
  530. while ($command ne "bye") {
  531. ## do not play more than a number of commands
  532. ## if the argument -n was not passed to blackjack
  533. if ($i++ == 1234567) {
  534. print "quit\n";
  535. }
  536. ## read and process the commands
  537. chomp($command = <STDIN>);
  538. if ($command eq "bet?") {
  539. print "1\n";
  540. } elsif ($command eq "insurance?") {
  541. print "no\n";
  542. } elsif ($comm eq "play?") {
  543. @tokens = split(/ /, $command);
  544. if ($tokens[1] < 12) {
  545. print "hit\n";
  546. } else {
  547. print "stand\n";
  548. }
  549. }
  550. }
  551. @end verbatim
  552. The very same player may be implemented as a shell script:
  553. @verbatim
  554. ##!/bin/sh
  555. i=0
  556. while read command
  557. do
  558. i=$((i+1))
  559. if test ${i} -ge 12345; then
  560. echo "quit"
  561. elif test "${command}" = 'bye'; then
  562. exit
  563. elif test "${command}" = 'bet?'; then
  564. echo 1
  565. elif test "${command}" = 'insurance?'; then
  566. echo "no"
  567. elif test "$(echo ${command} | cut -c-5)" = 'play?'; then
  568. count=$(echo ${command} | cut -f2 -d" ")
  569. if test ${count} -lt 12; then
  570. echo "hit"
  571. else
  572. echo "stand"
  573. fi
  574. fi
  575. done
  576. @end verbatim
  577. To check these two players give the same results, make them play against
  578. Libre@ Blackjack with the same seed (say one) and send the YAML report
  579. to two different files:
  580. @verbatim
  581. blackjack -n1e5 --rng_seed=1 --report_file_path=perl.yml < fifo | ./no-bust.pl > fifo
  582. blackjack -n1e5 --rng_seed=1 --report_file_path=shell.yml < fifo | ./no-bust.awk > fifo
  583. diff perl.yml shell.yml
  584. @end verbatim
  585. As expected, the reports are the same. They just differ in the speed
  586. because the shell script is orders of magnitude slower than its
  587. Perl-based counterpart.
  588. @quotation
  589. @strong{Exercise:} modify the players so they always insure aces and see
  590. if it improves or degrades the result.
  591. @end quotation
  592. @node Mimic the dealer
  593. @section Mimic the dealer
  594. @anchor{#mimic-the-dealer}
  595. This example implements a ``mimic-the-dealer strategy,'' i.e.@ hits if
  596. the hand totals less than seventeen and stands on eighteen or more. The
  597. player stands on hard seventeen but hits on soft seventeen.
  598. This time, the configuration file @code{blackjack.conf} is used. If a
  599. file with this name exists in the directory where @code{blackjack} is
  600. executed, it is read and parsed. The options should be fairly self
  601. descriptive. See the @ref{#configuration-file,configuration file}
  602. section of the manual for a detailed explanation of the variables and
  603. values that can be entered. In particular, we ask to play one hundred
  604. thousand hands at a six-deck game where the dealer hits soft seventeens.
  605. If the random seed is set to a fixed value so each execution will lead
  606. to the very same sequence of cards.
  607. Now, there are two options that tell Libre@ Blackjack how the player is
  608. going to talk to the backend: @code{player2dealer} and
  609. @code{dealer2player}. The first one sets the communication mechanism
  610. from the player to the dealer (by default is @code{blackjack}'s standard
  611. input), and the second one sets the mechanism from the dealer to the
  612. player (by default @code{blackjack}'s standard output). In this case,
  613. the configuration file reads:
  614. @verbatim
  615. h17 = true
  616. @end verbatim
  617. This means that two FIFOs (a.k.a. named pipes) are to be used for
  618. communication, @code{player2dealer} from the player to the dealer and
  619. @code{dealer2player} for the dealer to the player. If these FIFOs do not
  620. exist, they are created by @code{blackjack} upon execution.
  621. The player this time is implemented as an awk script, whose input should
  622. be read from @code{dealer2player} and whose output should be written to
  623. @code{player2dealer}. To run the game, execute @code{blackjack} in one
  624. terminal making sure the current directory is where the
  625. @code{blackjack.conf} file exists. It should print a message telling
  626. that it is waiting for someone to be at the other side of the named
  627. pipes:
  628. @verbatim
  629. $ blackjack
  630. @end verbatim
  631. In another terminal run the player
  632. @verbatim
  633. $ ./mimic-the-dealer.awk < dealer2player > player2dealer
  634. @end verbatim
  635. Both dealer and player may be run in the same terminal putting the first
  636. one on the background:
  637. @verbatim
  638. rm -f d2p p2d; mkfifo d2p p2d
  639. gawk -f mimic-the-dealer.awk < d2p > p2d &
  640. blackjack -n1e5 > d2p < p2d
  641. @end verbatim
  642. To understand the decisions taken by the player, we have to remember
  643. that when Libre@ Blackjack receives the command @code{count} asking for
  644. the current player's count, it returns a positive number for hard hands
  645. and a negative number for soft hands. The instructions @code{fflush()}
  646. are needed in order to avoid deadlocks on the named pipes:
  647. @verbatim
  648. ##!/usr/bin/gawk -f
  649. function abs(x){return ( x >= 0 ) ? x : -x }
  650. /bet\?/ {
  651. print "1";
  652. fflush();
  653. }
  654. /insurance\?/ {
  655. print "no";
  656. fflush();
  657. }
  658. /play\?/ {
  659. ## mimic the dealer: hit until 17 (hit soft 17)
  660. if (abs($2) < 17 || $2 == -17) { ## soft hands are negative
  661. print "hit";
  662. } else {
  663. print "stand";
  664. }
  665. fflush();
  666. }
  667. /bye/ {
  668. exit;
  669. }
  670. @end verbatim
  671. @verbatim
  672. result: "(-5.7 ± 0.9) %"
  673. mean: -0.05716
  674. error: 0.00926292
  675. hands: 100000
  676. bankroll: -5716
  677. bustsPlayer: 0.27064
  678. bustsDealer: 0.18905
  679. wins: 0.41088
  680. pushes: 0.09888
  681. losses: 0.49024
  682. @end verbatim
  683. @quotation
  684. @strong{Exercise:} modify the player and the configuration file so both
  685. the dealer and the player may stand on soft seventeen. Analyze the four
  686. combinations (player h17 - dealer h17, player h17 - dealer s17, player
  687. s17 - dealer h17, player s17 - dealer s17)
  688. @end quotation
  689. @node Derivation of the basic strategy
  690. @section Derivation of the basic strategy
  691. @anchor{#derivation-of-the-basic-strategy}
  692. @menu
  693. * Quick run::
  694. * Full table with results::
  695. * Detailed explanation::
  696. * Implementation::
  697. @end menu
  698. @node Quick run
  699. @subsection Quick run
  700. @anchor{#quick-run}
  701. Execute the @code{run.sh} script. It should take a few minutes:
  702. @verbatim
  703. $ ./run.sh
  704. h20-2 (10 10) 8.0e+04 +63.23 (1.1) -171.17 (1.1) -85.32 (0.5) stand
  705. h20-3 (10 10) 8.0e+04 +64.54 (1.1) -171.50 (1.1) -85.50 (0.5) stand
  706. h20-4 (10 10) 8.0e+04 +65.55 (1.1) -170.33 (1.1) -85.50 (0.5) stand
  707. h20-5 (10 10) 8.0e+04 +66.65 (1.1) -171.25 (1.1) -85.51 (0.5) stand
  708. h20-6 (10 10) 8.0e+04 +67.80 (1.1) -171.07 (1.1) -85.59 (0.5) stand
  709. h20-7 (10 10) 8.0e+04 +77.44 (1.1) -170.53 (1.1) -85.44 (0.5) stand
  710. h20-8 (10 10) 8.0e+04 +79.11 (1.1) -170.08 (1.1) -85.02 (0.6) stand
  711. h20-9 (10 10) 8.0e+04 +75.77 (1.1) -170.31 (1.1) -84.87 (0.6) stand
  712. p2-6 8e+04 +24.78 (2.9) +3.07 (1.0) yes
  713. p2-7 8e+04 +1.48 (2.0) -8.90 (1.0) yes
  714. p2-8 8e+04 -17.57 (2.0) -16.33 (1.0) uncertain
  715. p2-8 3e+05 -17.88 (1.0) -16.10 (0.5) no
  716. p2-9 8e+04 -38.73 (2.0) -24.38 (1.0) no
  717. p2-T 8e+04 -54.45 (1.8) -34.92 (0.9) no
  718. p2-A 8e+04 -67.11 (1.5) -51.59 (0.9) no
  719. @end verbatim
  720. A new text file called @code{bs.txt} with the strategy should be created
  721. from scratch:
  722. @verbatim
  723. ## 2 3 4 5 6 7 8 9 T A
  724. h20 s s s s s s s s s s
  725. h19 s s s s s s s s s s
  726. h18 s s s s s s s s s s
  727. h17 s s s s s s s s s s
  728. h16 s s s s s h h h h h
  729. h15 s s s s s h h h h h
  730. h14 s s s s s h h h h h
  731. h13 s s s s s h h h h h
  732. h12 h h s s s h h h h h
  733. h11 d d d d d d d d d d
  734. h10 d d d d d d d d h h
  735. h9 h d d d d h h h h h
  736. h8 h h h h h h h h h h
  737. h7 h h h h h h h h h h
  738. h6 h h h h h h h h h h
  739. h5 h h h h h h h h h h
  740. h4 h h h h h h h h h h
  741. ## 2 3 4 5 6 7 8 9 T A
  742. s20 s s s s s s s s s s
  743. s19 s s s s d s s s s s
  744. s18 d d d d d s s h h h
  745. s17 h d d d d h h h h h
  746. s16 h h d d d h h h h h
  747. s15 h h d d d h h h h h
  748. s14 h h h d d h h h h h
  749. s13 h h h h d h h h h h
  750. s12 h h h h d h h h h h
  751. ## 2 3 4 5 6 7 8 9 T A
  752. pA y y y y y y y y y y
  753. pT n n n n n n n n n n
  754. p9 y y y y y n y y n n
  755. p8 y y y y y y y y y y
  756. p7 y y y y y y n n n n
  757. p6 y y y y y n n n n n
  758. p5 n n n n n n n n n n
  759. p4 n n n y y n n n n n
  760. p3 y y y y y y n n n n
  761. p2 y y y y y y n n n n
  762. @end verbatim
  763. @node Full table with results
  764. @subsection Full table with results
  765. @anchor{#full-table-with-results}
  766. The script computes the expected value of each combination
  767. @enumerate
  768. @item
  769. Player's hand (hard, soft and pair)
  770. @item
  771. Dealer upcard
  772. @item
  773. Hit, double or stand (for hard and soft hands) and splitting or not (for
  774. pairs)
  775. @end enumerate
  776. The results are given as the expected value in percentage with the
  777. uncertainty (one standard deviation) in the last significant digit.
  778. @multitable {s12-A} {Hands needed} {-72.15 (1.6)} {-35.17 (0.9)} {-113.22 (1.4)} {double}
  779. @headitem
  780. Hand
  781. @tab Hands needed
  782. @tab Stand [%]
  783. @tab Double [%]
  784. @tab Hit [%]
  785. @tab Play
  786. @item
  787. h20-2
  788. @tab 8.0e+04
  789. @tab +63.55 (1.1)
  790. @tab -85.62 (0.5)
  791. @tab -171.16 (1.1)
  792. @tab stand
  793. @item
  794. h20-3
  795. @tab 8.0e+04
  796. @tab +64.58 (1.1)
  797. @tab -85.56 (0.5)
  798. @tab -170.56 (1.1)
  799. @tab stand
  800. @item
  801. h20-4
  802. @tab 8.0e+04
  803. @tab +65.30 (1.1)
  804. @tab -85.70 (0.5)
  805. @tab -171.10 (1.1)
  806. @tab stand
  807. @item
  808. h20-5
  809. @tab 8.0e+04
  810. @tab +67.04 (1.1)
  811. @tab -85.52 (0.5)
  812. @tab -171.34 (1.1)
  813. @tab stand
  814. @item
  815. h20-6
  816. @tab 8.0e+04
  817. @tab +67.81 (1.1)
  818. @tab -85.17 (0.5)
  819. @tab -170.61 (1.1)
  820. @tab stand
  821. @item
  822. h20-7
  823. @tab 8.0e+04
  824. @tab +77.12 (1.1)
  825. @tab -85.13 (0.6)
  826. @tab -170.32 (1.1)
  827. @tab stand
  828. @item
  829. h20-8
  830. @tab 8.0e+04
  831. @tab +79.14 (1.1)
  832. @tab -84.99 (0.6)
  833. @tab -170.46 (1.1)
  834. @tab stand
  835. @item
  836. h20-9
  837. @tab 8.0e+04
  838. @tab +75.94 (1.1)
  839. @tab -85.00 (0.6)
  840. @tab -169.53 (1.1)
  841. @tab stand
  842. @item
  843. h20-T
  844. @tab 8.0e+04
  845. @tab +43.51 (1.1)
  846. @tab -86.06 (0.5)
  847. @tab -164.02 (1.1)
  848. @tab stand
  849. @item
  850. h20-A
  851. @tab 8.0e+04
  852. @tab +10.86 (1.0)
  853. @tab -89.62 (0.5)
  854. @tab -149.06 (1.0)
  855. @tab stand
  856. @item
  857. h19-2
  858. @tab 8.0e+04
  859. @tab +37.41 (1.4)
  860. @tab -73.09 (0.7)
  861. @tab -146.25 (1.4)
  862. @tab stand
  863. @item
  864. h19-3
  865. @tab 8.0e+04
  866. @tab +40.09 (1.4)
  867. @tab -72.96 (0.7)
  868. @tab -145.29 (1.4)
  869. @tab stand
  870. @item
  871. h19-4
  872. @tab 8.0e+04
  873. @tab +41.38 (1.4)
  874. @tab -72.80 (0.7)
  875. @tab -146.07 (1.4)
  876. @tab stand
  877. @item
  878. h19-5
  879. @tab 8.0e+04
  880. @tab +43.76 (1.4)
  881. @tab -72.76 (0.7)
  882. @tab -144.19 (1.4)
  883. @tab stand
  884. @item
  885. h19-6
  886. @tab 8.0e+04
  887. @tab +45.80 (1.4)
  888. @tab -72.62 (0.7)
  889. @tab -145.14 (1.4)
  890. @tab stand
  891. @item
  892. h19-7
  893. @tab 8.0e+04
  894. @tab +61.39 (1.5)
  895. @tab -71.50 (0.7)
  896. @tab -143.39 (1.5)
  897. @tab stand
  898. @item
  899. h19-8
  900. @tab 8.0e+04
  901. @tab +59.58 (1.5)
  902. @tab -71.36 (0.7)
  903. @tab -143.03 (1.5)
  904. @tab stand
  905. @item
  906. h19-9
  907. @tab 8.0e+04
  908. @tab +28.15 (1.5)
  909. @tab -71.59 (0.7)
  910. @tab -143.42 (1.5)
  911. @tab stand
  912. @item
  913. h19-T
  914. @tab 8.0e+04
  915. @tab -2.00 (1.3)
  916. @tab -74.91 (0.7)
  917. @tab -142.88 (1.3)
  918. @tab stand
  919. @item
  920. h19-A
  921. @tab 8.0e+04
  922. @tab -18.04 (1.2)
  923. @tab -81.43 (0.6)
  924. @tab -131.46 (1.2)
  925. @tab stand
  926. @item
  927. h18-2
  928. @tab 8.0e+04
  929. @tab +11.02 (1.6)
  930. @tab -62.22 (0.8)
  931. @tab -123.71 (1.6)
  932. @tab stand
  933. @item
  934. h18-3
  935. @tab 8.0e+04
  936. @tab +13.20 (1.6)
  937. @tab -61.53 (0.8)
  938. @tab -124.35 (1.6)
  939. @tab stand
  940. @item
  941. h18-4
  942. @tab 8.0e+04
  943. @tab +16.92 (1.6)
  944. @tab -61.80 (0.8)
  945. @tab -123.86 (1.6)
  946. @tab stand
  947. @item
  948. h18-5
  949. @tab 8.0e+04
  950. @tab +19.35 (1.6)
  951. @tab -61.38 (0.8)
  952. @tab -123.62 (1.6)
  953. @tab stand
  954. @item
  955. h18-6
  956. @tab 8.0e+04
  957. @tab +22.36 (1.6)
  958. @tab -61.35 (0.8)
  959. @tab -121.85 (1.6)
  960. @tab stand
  961. @item
  962. h18-7
  963. @tab 8.0e+04
  964. @tab +39.35 (1.7)
  965. @tab -59.36 (0.8)
  966. @tab -118.48 (1.7)
  967. @tab stand
  968. @item
  969. h18-8
  970. @tab 8.0e+04
  971. @tab +10.34 (1.7)
  972. @tab -58.35 (0.8)
  973. @tab -117.43 (1.7)
  974. @tab stand
  975. @item
  976. h18-9
  977. @tab 8.0e+04
  978. @tab -18.74 (1.6)
  979. @tab -61.52 (0.8)
  980. @tab -123.34 (1.6)
  981. @tab stand
  982. @item
  983. h18-T
  984. @tab 8.0e+04
  985. @tab -23.84 (1.5)
  986. @tab -67.55 (0.8)
  987. @tab -127.96 (1.5)
  988. @tab stand
  989. @item
  990. h18-A
  991. @tab 8.0e+04
  992. @tab -46.97 (1.3)
  993. @tab -74.64 (0.7)
  994. @tab -118.63 (1.3)
  995. @tab stand
  996. @item
  997. h17-2
  998. @tab 8.0e+04
  999. @tab -15.44 (1.7)
  1000. @tab -53.93 (0.9)
  1001. @tab -108.61 (1.7)
  1002. @tab stand
  1003. @item
  1004. h17-3
  1005. @tab 8.0e+04
  1006. @tab -12.18 (1.8)
  1007. @tab -53.57 (0.9)
  1008. @tab -105.83 (1.8)
  1009. @tab stand
  1010. @item
  1011. h17-4
  1012. @tab 8.0e+04
  1013. @tab -8.33 (1.8)
  1014. @tab -52.86 (0.9)
  1015. @tab -105.69 (1.8)
  1016. @tab stand
  1017. @item
  1018. h17-5
  1019. @tab 8.0e+04
  1020. @tab -4.55 (1.8)
  1021. @tab -51.66 (0.9)
  1022. @tab -105.34 (1.8)
  1023. @tab stand
  1024. @item
  1025. h17-6
  1026. @tab 8.0e+04
  1027. @tab -1.15 (1.8)
  1028. @tab -51.94 (0.9)
  1029. @tab -104.07 (1.8)
  1030. @tab stand
  1031. @item
  1032. h17-7
  1033. @tab 8.0e+04
  1034. @tab -10.79 (1.8)
  1035. @tab -48.10 (0.9)
  1036. @tab -96.43 (1.8)
  1037. @tab stand
  1038. @item
  1039. h17-8
  1040. @tab 8.0e+04
  1041. @tab -38.74 (1.8)
  1042. @tab -50.44 (0.9)
  1043. @tab -101.03 (1.8)
  1044. @tab stand
  1045. @item
  1046. h17-9
  1047. @tab 8.0e+04
  1048. @tab -42.54 (1.7)
  1049. @tab -55.42 (0.8)
  1050. @tab -111.46 (1.7)
  1051. @tab stand
  1052. @item
  1053. h17-T
  1054. @tab 8.0e+04
  1055. @tab -46.12 (1.6)
  1056. @tab -61.91 (0.8)
  1057. @tab -115.53 (1.6)
  1058. @tab stand
  1059. @item
  1060. h17-A
  1061. @tab 8.0e+04
  1062. @tab -66.10 (1.4)
  1063. @tab -70.80 (0.7)
  1064. @tab -110.62 (1.4)
  1065. @tab stand
  1066. @item
  1067. h16-2
  1068. @tab 8.0e+04
  1069. @tab -28.62 (1.8)
  1070. @tab -47.46 (0.9)
  1071. @tab -95.12 (1.8)
  1072. @tab stand
  1073. @item
  1074. h16-3
  1075. @tab 8.0e+04
  1076. @tab -24.81 (1.8)
  1077. @tab -46.52 (0.9)
  1078. @tab -93.95 (1.8)
  1079. @tab stand
  1080. @item
  1081. h16-4
  1082. @tab 8.0e+04
  1083. @tab -20.67 (1.8)
  1084. @tab -45.46 (0.9)
  1085. @tab -91.92 (1.8)
  1086. @tab stand
  1087. @item
  1088. h16-5
  1089. @tab 8.0e+04
  1090. @tab -16.48 (1.8)
  1091. @tab -45.18 (0.9)
  1092. @tab -89.56 (1.8)
  1093. @tab stand
  1094. @item
  1095. h16-6
  1096. @tab 8.0e+04
  1097. @tab -11.55 (1.9)
  1098. @tab -44.39 (0.9)
  1099. @tab -87.64 (1.9)
  1100. @tab stand
  1101. @item
  1102. h16-7
  1103. @tab 8.0e+04
  1104. @tab -47.14 (1.9)
  1105. @tab -41.27 (0.9)
  1106. @tab -84.33 (1.9)
  1107. @tab hit
  1108. @item
  1109. h16-8
  1110. @tab 8.0e+04
  1111. @tab -50.94 (1.8)
  1112. @tab -45.95 (0.9)
  1113. @tab -92.12 (1.8)
  1114. @tab hit
  1115. @item
  1116. h16-9
  1117. @tab 8.0e+04
  1118. @tab -54.50 (1.7)
  1119. @tab -50.71 (0.9)
  1120. @tab -102.58 (1.7)
  1121. @tab hit
  1122. @item
  1123. h16-T
  1124. @tab 2.0e+07
  1125. @tab -57.57 (0)
  1126. @tab -57.53 (0)
  1127. @tab -107.34 (0)
  1128. @tab hit
  1129. @item
  1130. h16-A
  1131. @tab 8.0e+04
  1132. @tab -72.39 (1.4)
  1133. @tab -68.19 (0.7)
  1134. @tab -105.24 (1.4)
  1135. @tab hit
  1136. @item
  1137. h15-2
  1138. @tab 8.0e+04
  1139. @tab -28.36 (1.9)
  1140. @tab -41.53 (0.9)
  1141. @tab -83.65 (1.9)
  1142. @tab stand
  1143. @item
  1144. h15-3
  1145. @tab 8.0e+04
  1146. @tab -25.21 (1.9)
  1147. @tab -40.72 (0.9)
  1148. @tab -81.48 (1.9)
  1149. @tab stand
  1150. @item
  1151. h15-4
  1152. @tab 8.0e+04
  1153. @tab -20.66 (1.9)
  1154. @tab -39.38 (0.9)
  1155. @tab -78.86 (1.9)
  1156. @tab stand
  1157. @item
  1158. h15-5
  1159. @tab 8.0e+04
  1160. @tab -16.55 (1.9)
  1161. @tab -38.38 (1.0)
  1162. @tab -77.57 (1.9)
  1163. @tab stand
  1164. @item
  1165. h15-6
  1166. @tab 8.0e+04
  1167. @tab -11.88 (1.9)
  1168. @tab -37.86 (1.0)
  1169. @tab -75.22 (1.9)
  1170. @tab stand
  1171. @item
  1172. h15-7
  1173. @tab 8.0e+04
  1174. @tab -48.09 (1.9)
  1175. @tab -37.04 (0.9)
  1176. @tab -75.35 (1.9)
  1177. @tab hit
  1178. @item
  1179. h15-8
  1180. @tab 8.0e+04
  1181. @tab -50.84 (1.9)
  1182. @tab -41.53 (0.9)
  1183. @tab -83.94 (1.9)
  1184. @tab hit
  1185. @item
  1186. h15-9
  1187. @tab 8.0e+04
  1188. @tab -54.38 (1.8)
  1189. @tab -47.30 (0.9)
  1190. @tab -95.06 (1.8)
  1191. @tab hit
  1192. @item
  1193. h15-T
  1194. @tab 8.0e+04
  1195. @tab -57.73 (1.7)
  1196. @tab -54.62 (0.9)
  1197. @tab -99.81 (1.7)
  1198. @tab hit
  1199. @item
  1200. h15-A
  1201. @tab 8.0e+04
  1202. @tab -72.00 (1.5)
  1203. @tab -65.80 (0.8)
  1204. @tab -101.33 (1.5)
  1205. @tab hit
  1206. @item
  1207. h14-2
  1208. @tab 8.0e+04
  1209. @tab -28.56 (1.9)
  1210. @tab -36.62 (1.0)
  1211. @tab -72.17 (1.9)
  1212. @tab stand
  1213. @item
  1214. h14-3
  1215. @tab 8.0e+04
  1216. @tab -24.12 (1.9)
  1217. @tab -34.63 (1.0)
  1218. @tab -70.90 (1.9)
  1219. @tab stand
  1220. @item
  1221. h14-4
  1222. @tab 8.0e+04
  1223. @tab -20.48 (1.9)
  1224. @tab -33.73 (1.0)
  1225. @tab -68.97 (1.9)
  1226. @tab stand
  1227. @item
  1228. h14-5
  1229. @tab 8.0e+04
  1230. @tab -16.54 (2.0)
  1231. @tab -31.93 (1.0)
  1232. @tab -64.39 (2.0)
  1233. @tab stand
  1234. @item
  1235. h14-6
  1236. @tab 8.0e+04
  1237. @tab -12.19 (2.0)
  1238. @tab -30.64 (1.0)
  1239. @tab -60.75 (2.0)
  1240. @tab stand
  1241. @item
  1242. h14-7
  1243. @tab 8.0e+04
  1244. @tab -47.85 (1.9)
  1245. @tab -32.25 (1.0)
  1246. @tab -66.44 (1.9)
  1247. @tab hit
  1248. @item
  1249. h14-8
  1250. @tab 8.0e+04
  1251. @tab -51.09 (1.9)
  1252. @tab -37.59 (0.9)
  1253. @tab -76.59 (1.9)
  1254. @tab hit
  1255. @item
  1256. h14-9
  1257. @tab 8.0e+04
  1258. @tab -54.41 (1.8)
  1259. @tab -43.27 (0.9)
  1260. @tab -87.80 (1.8)
  1261. @tab hit
  1262. @item
  1263. h14-T
  1264. @tab 8.0e+04
  1265. @tab -57.74 (1.7)
  1266. @tab -50.71 (0.9)
  1267. @tab -94.55 (1.7)
  1268. @tab hit
  1269. @item
  1270. h14-A
  1271. @tab 8.0e+04
  1272. @tab -72.11 (1.5)
  1273. @tab -62.81 (0.8)
  1274. @tab -97.57 (1.5)
  1275. @tab hit
  1276. @item
  1277. h13-2
  1278. @tab 3.2e+05
  1279. @tab -28.58 (1.0)
  1280. @tab -30.97 (0.5)
  1281. @tab -61.58 (1.0)
  1282. @tab stand
  1283. @item
  1284. h13-3
  1285. @tab 8.0e+04
  1286. @tab -24.61 (2.0)
  1287. @tab -29.17 (1.0)
  1288. @tab -58.99 (2.0)
  1289. @tab stand
  1290. @item
  1291. h13-4
  1292. @tab 8.0e+04
  1293. @tab -21.15 (2.0)
  1294. @tab -27.05 (1.0)
  1295. @tab -55.31 (2.0)
  1296. @tab stand
  1297. @item
  1298. h13-5
  1299. @tab 8.0e+04
  1300. @tab -16.88 (2.0)
  1301. @tab -26.15 (1.0)
  1302. @tab -50.31 (2.0)
  1303. @tab stand
  1304. @item
  1305. h13-6
  1306. @tab 8.0e+04
  1307. @tab -12.35 (2.0)
  1308. @tab -24.12 (1.0)
  1309. @tab -47.91 (2.0)
  1310. @tab stand
  1311. @item
  1312. h13-7
  1313. @tab 8.0e+04
  1314. @tab -47.50 (2.0)
  1315. @tab -26.69 (1.0)
  1316. @tab -58.47 (2.0)
  1317. @tab hit
  1318. @item
  1319. h13-8
  1320. @tab 8.0e+04
  1321. @tab -51.33 (1.9)
  1322. @tab -32.22 (1.0)
  1323. @tab -70.19 (1.9)
  1324. @tab hit
  1325. @item
  1326. h13-9
  1327. @tab 8.0e+04
  1328. @tab -54.31 (1.9)
  1329. @tab -38.57 (0.9)
  1330. @tab -80.97 (1.9)
  1331. @tab hit
  1332. @item
  1333. h13-T
  1334. @tab 8.0e+04
  1335. @tab -56.99 (1.8)
  1336. @tab -46.49 (0.9)
  1337. @tab -87.36 (1.8)
  1338. @tab hit
  1339. @item
  1340. h13-A
  1341. @tab 8.0e+04
  1342. @tab -72.39 (1.5)
  1343. @tab -60.33 (0.8)
  1344. @tab -92.36 (1.5)
  1345. @tab hit
  1346. @item
  1347. h12-2
  1348. @tab 8.0e+04
  1349. @tab -28.53 (2.0)
  1350. @tab -25.26 (1.0)
  1351. @tab -50.10 (2.0)
  1352. @tab hit
  1353. @item
  1354. h12-3
  1355. @tab 3.2e+05
  1356. @tab -24.74 (1.0)
  1357. @tab -23.20 (0.5)
  1358. @tab -47.17 (1.0)
  1359. @tab hit
  1360. @item
  1361. h12-4
  1362. @tab 5.1e+06
  1363. @tab -20.50 (0.3)
  1364. @tab -21.34 (0.1)
  1365. @tab -42.80 (0.3)
  1366. @tab stand
  1367. @item
  1368. h12-5
  1369. @tab 3.2e+05
  1370. @tab -16.67 (1.0)
  1371. @tab -19.49 (0.5)
  1372. @tab -38.59 (1.0)
  1373. @tab stand
  1374. @item
  1375. h12-6
  1376. @tab 8.0e+04
  1377. @tab -11.57 (2.0)
  1378. @tab -17.45 (1.0)
  1379. @tab -34.91 (2.0)
  1380. @tab stand
  1381. @item
  1382. h12-7
  1383. @tab 8.0e+04
  1384. @tab -47.16 (2.0)
  1385. @tab -21.22 (1.0)
  1386. @tab -49.56 (2.0)
  1387. @tab hit
  1388. @item
  1389. h12-8
  1390. @tab 8.0e+04
  1391. @tab -51.23 (2.0)
  1392. @tab -26.82 (1.0)
  1393. @tab -61.96 (2.0)
  1394. @tab hit
  1395. @item
  1396. h12-9
  1397. @tab 8.0e+04
  1398. @tab -54.02 (1.9)
  1399. @tab -33.93 (1.0)
  1400. @tab -74.10 (1.9)
  1401. @tab hit
  1402. @item
  1403. h12-T
  1404. @tab 8.0e+04
  1405. @tab -58.14 (1.8)
  1406. @tab -43.03 (0.9)
  1407. @tab -82.21 (1.8)
  1408. @tab hit
  1409. @item
  1410. h12-A
  1411. @tab 8.0e+04
  1412. @tab -72.60 (1.5)
  1413. @tab -57.38 (0.8)
  1414. @tab -88.89 (1.5)
  1415. @tab hit
  1416. @item
  1417. h11-2
  1418. @tab 8.0e+04
  1419. @tab -27.73 (2.0)
  1420. @tab +23.74 (1.0)
  1421. @tab +46.68 (2.0)
  1422. @tab double
  1423. @item
  1424. h11-3
  1425. @tab 8.0e+04
  1426. @tab -24.81 (2.0)
  1427. @tab +26.30 (1.0)
  1428. @tab +50.86 (2.0)
  1429. @tab double
  1430. @item
  1431. h11-4
  1432. @tab 8.0e+04
  1433. @tab -20.28 (2.0)
  1434. @tab +28.91 (1.0)
  1435. @tab +56.46 (2.0)
  1436. @tab double
  1437. @item
  1438. h11-5
  1439. @tab 8.0e+04
  1440. @tab -16.10 (1.9)
  1441. @tab +31.08 (1.0)
  1442. @tab +60.58 (1.9)
  1443. @tab double
  1444. @item
  1445. h11-6
  1446. @tab 8.0e+04
  1447. @tab -12.18 (1.9)
  1448. @tab +33.16 (1.0)
  1449. @tab +67.19 (1.9)
  1450. @tab double
  1451. @item
  1452. h11-7
  1453. @tab 8.0e+04
  1454. @tab -47.49 (2.0)
  1455. @tab +29.49 (1.0)
  1456. @tab +46.09 (2.0)
  1457. @tab double
  1458. @item
  1459. h11-8
  1460. @tab 8.0e+04
  1461. @tab -51.29 (2.0)
  1462. @tab +22.39 (1.0)
  1463. @tab +34.94 (2.0)
  1464. @tab double
  1465. @item
  1466. h11-9
  1467. @tab 8.0e+04
  1468. @tab -54.41 (2.0)
  1469. @tab +15.62 (1.0)
  1470. @tab +23.72 (2.0)
  1471. @tab double
  1472. @item
  1473. h11-T
  1474. @tab 8.0e+04
  1475. @tab -57.70 (2.0)
  1476. @tab +3.21 (1.0)
  1477. @tab +9.84 (2.0)
  1478. @tab double
  1479. @item
  1480. h11-A
  1481. @tab 2.0e+07
  1482. @tab -72.22 (0)
  1483. @tab -23.67 (0)
  1484. @tab -23.56 (0)
  1485. @tab double
  1486. @item
  1487. h10-2
  1488. @tab 8.0e+04
  1489. @tab -28.45 (2.0)
  1490. @tab +18.25 (1.0)
  1491. @tab +35.73 (2.0)
  1492. @tab double
  1493. @item
  1494. h10-3
  1495. @tab 8.0e+04
  1496. @tab -23.99 (2.0)
  1497. @tab +20.70 (1.0)
  1498. @tab +40.59 (2.0)
  1499. @tab double
  1500. @item
  1501. h10-4
  1502. @tab 8.0e+04
  1503. @tab -21.31 (2.0)
  1504. @tab +23.14 (1.0)
  1505. @tab +46.54 (2.0)
  1506. @tab double
  1507. @item
  1508. h10-5
  1509. @tab 8.0e+04
  1510. @tab -16.23 (2.0)
  1511. @tab +25.77 (1.0)
  1512. @tab +51.66 (2.0)
  1513. @tab double
  1514. @item
  1515. h10-6
  1516. @tab 8.0e+04
  1517. @tab -12.01 (2.0)
  1518. @tab +28.63 (1.0)
  1519. @tab +56.36 (2.0)
  1520. @tab double
  1521. @item
  1522. h10-7
  1523. @tab 8.0e+04
  1524. @tab -47.40 (2.0)
  1525. @tab +25.23 (1.0)
  1526. @tab +38.38 (2.0)
  1527. @tab double
  1528. @item
  1529. h10-8
  1530. @tab 8.0e+04
  1531. @tab -51.35 (2.0)
  1532. @tab +20.43 (1.0)
  1533. @tab +28.63 (2.0)
  1534. @tab double
  1535. @item
  1536. h10-9
  1537. @tab 3.2e+05
  1538. @tab -54.13 (1.0)
  1539. @tab +11.81 (0.5)
  1540. @tab +15.23 (1.0)
  1541. @tab double
  1542. @item
  1543. h10-T
  1544. @tab 8.0e+04
  1545. @tab -58.04 (1.9)
  1546. @tab -5.84 (1.0)
  1547. @tab -7.94 (1.9)
  1548. @tab hit
  1549. @item
  1550. h10-A
  1551. @tab 8.0e+04
  1552. @tab -72.46 (1.7)
  1553. @tab -28.90 (1.0)
  1554. @tab -33.54 (1.7)
  1555. @tab hit
  1556. @item
  1557. h9-2
  1558. @tab 3.2e+05
  1559. @tab -28.82 (1.0)
  1560. @tab +7.62 (0.5)
  1561. @tab +5.95 (1.0)
  1562. @tab hit
  1563. @item
  1564. h9-3
  1565. @tab 3.2e+05
  1566. @tab -24.59 (1.0)
  1567. @tab +9.93 (0.5)
  1568. @tab +11.94 (1.0)
  1569. @tab double
  1570. @item
  1571. h9-4
  1572. @tab 8.0e+04
  1573. @tab -20.79 (2.0)
  1574. @tab +12.15 (1.0)
  1575. @tab +17.76 (2.0)
  1576. @tab double
  1577. @item
  1578. h9-5
  1579. @tab 8.0e+04
  1580. @tab -16.50 (2.0)
  1581. @tab +15.92 (1.0)
  1582. @tab +23.51 (2.0)
  1583. @tab double
  1584. @item
  1585. h9-6
  1586. @tab 8.0e+04
  1587. @tab -12.35 (2.0)
  1588. @tab +19.57 (1.0)
  1589. @tab +30.65 (2.0)
  1590. @tab double
  1591. @item
  1592. h9-7
  1593. @tab 8.0e+04
  1594. @tab -47.62 (2.0)
  1595. @tab +17.20 (1.0)
  1596. @tab +10.00 (2.0)
  1597. @tab hit
  1598. @item
  1599. h9-8
  1600. @tab 8.0e+04
  1601. @tab -50.97 (2.0)
  1602. @tab +10.15 (1.0)
  1603. @tab -2.38 (2.0)
  1604. @tab hit
  1605. @item
  1606. h9-9
  1607. @tab 8.0e+04
  1608. @tab -53.95 (1.9)
  1609. @tab -4.61 (1.0)
  1610. @tab -29.84 (1.9)
  1611. @tab hit
  1612. @item
  1613. h9-T
  1614. @tab 8.0e+04
  1615. @tab -57.78 (1.9)
  1616. @tab -21.96 (1.0)
  1617. @tab -52.36 (1.9)
  1618. @tab hit
  1619. @item
  1620. h9-A
  1621. @tab 8.0e+04
  1622. @tab -72.33 (1.7)
  1623. @tab -38.77 (0.9)
  1624. @tab -61.26 (1.7)
  1625. @tab hit
  1626. @item
  1627. h8-2
  1628. @tab 8.0e+04
  1629. @tab -29.03 (2.0)
  1630. @tab -1.76 (1.0)
  1631. @tab -19.15 (2.0)
  1632. @tab hit
  1633. @item
  1634. h8-3
  1635. @tab 8.0e+04
  1636. @tab -25.61 (2.1)
  1637. @tab +0.33 (1.0)
  1638. @tab -13.68 (2.1)
  1639. @tab hit
  1640. @item
  1641. h8-4
  1642. @tab 8.0e+04
  1643. @tab -20.69 (2.1)
  1644. @tab +3.82 (1.0)
  1645. @tab -7.66 (2.1)
  1646. @tab hit
  1647. @item
  1648. h8-5
  1649. @tab 8.0e+04
  1650. @tab -16.06 (2.1)
  1651. @tab +7.53 (1.0)
  1652. @tab +0.32 (2.1)
  1653. @tab hit
  1654. @item
  1655. h8-6
  1656. @tab 3.2e+05
  1657. @tab -12.16 (1.0)
  1658. @tab +10.49 (0.5)
  1659. @tab +7.43 (1.0)
  1660. @tab hit
  1661. @item
  1662. h8-7
  1663. @tab 8.0e+04
  1664. @tab -47.34 (2.0)
  1665. @tab +8.56 (1.0)
  1666. @tab -16.64 (2.0)
  1667. @tab hit
  1668. @item
  1669. h8-8
  1670. @tab 8.0e+04
  1671. @tab -51.56 (1.9)
  1672. @tab -6.18 (1.0)
  1673. @tab -46.07 (1.9)
  1674. @tab hit
  1675. @item
  1676. h8-9
  1677. @tab 8.0e+04
  1678. @tab -54.44 (1.9)
  1679. @tab -21.65 (1.0)
  1680. @tab -71.64 (1.9)
  1681. @tab hit
  1682. @item
  1683. h8-T
  1684. @tab 8.0e+04
  1685. @tab -57.15 (1.8)
  1686. @tab -30.78 (1.0)
  1687. @tab -76.35 (1.8)
  1688. @tab hit
  1689. @item
  1690. h8-A
  1691. @tab 8.0e+04
  1692. @tab -72.01 (1.5)
  1693. @tab -49.02 (0.9)
  1694. @tab -88.47 (1.5)
  1695. @tab hit
  1696. @item
  1697. h7-2
  1698. @tab 8.0e+04
  1699. @tab -29.15 (2.0)
  1700. @tab -11.08 (1.0)
  1701. @tab -42.53 (2.0)
  1702. @tab hit
  1703. @item
  1704. h7-3
  1705. @tab 8.0e+04
  1706. @tab -24.37 (2.0)
  1707. @tab -7.51 (1.0)
  1708. @tab -34.68 (2.0)
  1709. @tab hit
  1710. @item
  1711. h7-4
  1712. @tab 8.0e+04
  1713. @tab -19.40 (2.1)
  1714. @tab -3.90 (1.0)
  1715. @tab -27.57 (2.1)
  1716. @tab hit
  1717. @item
  1718. h7-5
  1719. @tab 8.0e+04
  1720. @tab -16.84 (2.1)
  1721. @tab -0.53 (1.0)
  1722. @tab -20.59 (2.1)
  1723. @tab hit
  1724. @item
  1725. h7-6
  1726. @tab 8.0e+04
  1727. @tab -11.93 (2.1)
  1728. @tab +2.53 (1.0)
  1729. @tab -10.66 (2.1)
  1730. @tab hit
  1731. @item
  1732. h7-7
  1733. @tab 8.0e+04
  1734. @tab -47.22 (1.9)
  1735. @tab -7.33 (1.0)
  1736. @tab -59.71 (1.9)
  1737. @tab hit
  1738. @item
  1739. h7-8
  1740. @tab 8.0e+04
  1741. @tab -50.71 (1.8)
  1742. @tab -20.35 (1.0)
  1743. @tab -85.02 (1.8)
  1744. @tab hit
  1745. @item
  1746. h7-9
  1747. @tab 8.0e+04
  1748. @tab -54.12 (1.8)
  1749. @tab -29.11 (1.0)
  1750. @tab -96.16 (1.8)
  1751. @tab hit
  1752. @item
  1753. h7-T
  1754. @tab 8.0e+04
  1755. @tab -57.52 (1.7)
  1756. @tab -37.06 (0.9)
  1757. @tab -95.95 (1.7)
  1758. @tab hit
  1759. @item
  1760. h7-A
  1761. @tab 8.0e+04
  1762. @tab -72.23 (1.4)
  1763. @tab -55.54 (0.8)
  1764. @tab -104.99 (1.4)
  1765. @tab hit
  1766. @item
  1767. h6-2
  1768. @tab 8.0e+04
  1769. @tab -28.38 (2.0)
  1770. @tab -15.59 (1.0)
  1771. @tab -56.44 (2.0)
  1772. @tab hit
  1773. @item
  1774. h6-3
  1775. @tab 8.0e+04
  1776. @tab -24.34 (2.1)
  1777. @tab -11.56 (1.0)
  1778. @tab -46.62 (2.1)
  1779. @tab hit
  1780. @item
  1781. h6-4
  1782. @tab 8.0e+04
  1783. @tab -21.46 (2.1)
  1784. @tab -8.03 (1.0)
  1785. @tab -39.24 (2.1)
  1786. @tab hit
  1787. @item
  1788. h6-5
  1789. @tab 8.0e+04
  1790. @tab -16.68 (2.1)
  1791. @tab -4.95 (1.0)
  1792. @tab -31.10 (2.1)
  1793. @tab hit
  1794. @item
  1795. h6-6
  1796. @tab 8.0e+04
  1797. @tab -12.40 (2.1)
  1798. @tab -0.76 (1.0)
  1799. @tab -22.49 (2.1)
  1800. @tab hit
  1801. @item
  1802. h6-7
  1803. @tab 8.0e+04
  1804. @tab -47.58 (1.9)
  1805. @tab -16.43 (1.0)
  1806. @tab -89.56 (1.9)
  1807. @tab hit
  1808. @item
  1809. h6-8
  1810. @tab 8.0e+04
  1811. @tab -50.72 (1.8)
  1812. @tab -24.13 (1.0)
  1813. @tab -98.62 (1.8)
  1814. @tab hit
  1815. @item
  1816. h6-9
  1817. @tab 8.0e+04
  1818. @tab -54.32 (1.8)
  1819. @tab -31.34 (1.0)
  1820. @tab -107.41 (1.8)
  1821. @tab hit
  1822. @item
  1823. h6-T
  1824. @tab 8.0e+04
  1825. @tab -57.56 (1.7)
  1826. @tab -40.02 (0.9)
  1827. @tab -105.28 (1.7)
  1828. @tab hit
  1829. @item
  1830. h6-A
  1831. @tab 8.0e+04
  1832. @tab -72.04 (1.4)
  1833. @tab -56.31 (0.8)
  1834. @tab -112.37 (1.4)
  1835. @tab hit
  1836. @item
  1837. h5-2
  1838. @tab 8.0e+04
  1839. @tab -28.46 (2.0)
  1840. @tab -14.09 (1.0)
  1841. @tab -56.05 (2.0)
  1842. @tab hit
  1843. @item
  1844. h5-3
  1845. @tab 8.0e+04
  1846. @tab -24.73 (2.1)
  1847. @tab -11.80 (1.0)
  1848. @tab -49.48 (2.1)
  1849. @tab hit
  1850. @item
  1851. h5-4
  1852. @tab 8.0e+04
  1853. @tab -20.62 (2.1)
  1854. @tab -8.01 (1.0)
  1855. @tab -42.69 (2.1)
  1856. @tab hit
  1857. @item
  1858. h5-5
  1859. @tab 8.0e+04
  1860. @tab -16.47 (2.1)
  1861. @tab -4.45 (1.0)
  1862. @tab -32.88 (2.1)
  1863. @tab hit
  1864. @item
  1865. h5-6
  1866. @tab 8.0e+04
  1867. @tab -12.29 (2.1)
  1868. @tab -0.24 (1.0)
  1869. @tab -24.41 (2.1)
  1870. @tab hit
  1871. @item
  1872. h5-7
  1873. @tab 8.0e+04
  1874. @tab -47.07 (1.9)
  1875. @tab -16.19 (1.0)
  1876. @tab -94.28 (1.9)
  1877. @tab hit
  1878. @item
  1879. h5-8
  1880. @tab 8.0e+04
  1881. @tab -51.00 (1.8)
  1882. @tab -22.25 (1.0)
  1883. @tab -101.66 (1.8)
  1884. @tab hit
  1885. @item
  1886. h5-9
  1887. @tab 8.0e+04
  1888. @tab -54.20 (1.8)
  1889. @tab -29.74 (1.0)
  1890. @tab -107.96 (1.8)
  1891. @tab hit
  1892. @item
  1893. h5-T
  1894. @tab 8.0e+04
  1895. @tab -57.42 (1.7)
  1896. @tab -38.76 (0.9)
  1897. @tab -107.09 (1.7)
  1898. @tab hit
  1899. @item
  1900. h5-A
  1901. @tab 8.0e+04
  1902. @tab -72.39 (1.4)
  1903. @tab -54.71 (0.8)
  1904. @tab -114.03 (1.4)
  1905. @tab hit
  1906. @item
  1907. h4-2
  1908. @tab 8.0e+04
  1909. @tab -28.76 (2.0)
  1910. @tab -12.93 (1.0)
  1911. @tab -57.47 (2.0)
  1912. @tab hit
  1913. @item
  1914. h4-3
  1915. @tab 8.0e+04
  1916. @tab -24.68 (2.1)
  1917. @tab -10.48 (1.0)
  1918. @tab -49.92 (2.1)
  1919. @tab hit
  1920. @item
  1921. h4-4
  1922. @tab 8.0e+04
  1923. @tab -20.67 (2.1)
  1924. @tab -7.36 (1.0)
  1925. @tab -41.23 (2.1)
  1926. @tab hit
  1927. @item
  1928. h4-5
  1929. @tab 8.0e+04
  1930. @tab -16.91 (2.1)
  1931. @tab -3.43 (1.0)
  1932. @tab -32.59 (2.1)
  1933. @tab hit
  1934. @item
  1935. h4-6
  1936. @tab 8.0e+04
  1937. @tab -12.25 (2.1)
  1938. @tab +0.40 (1.0)
  1939. @tab -23.57 (2.1)
  1940. @tab hit
  1941. @item
  1942. h4-7
  1943. @tab 8.0e+04
  1944. @tab -47.75 (1.9)
  1945. @tab -12.72 (1.0)
  1946. @tab -94.73 (1.9)
  1947. @tab hit
  1948. @item
  1949. h4-8
  1950. @tab 8.0e+04
  1951. @tab -50.76 (1.8)
  1952. @tab -19.63 (1.0)
  1953. @tab -103.23 (1.8)
  1954. @tab hit
  1955. @item
  1956. h4-9
  1957. @tab 8.0e+04
  1958. @tab -54.06 (1.8)
  1959. @tab -28.13 (1.0)
  1960. @tab -108.57 (1.8)
  1961. @tab hit
  1962. @item
  1963. h4-T
  1964. @tab 8.0e+04
  1965. @tab -56.86 (1.7)
  1966. @tab -36.62 (0.9)
  1967. @tab -107.18 (1.7)
  1968. @tab hit
  1969. @item
  1970. h4-A
  1971. @tab 8.0e+04
  1972. @tab -72.38 (1.4)
  1973. @tab -53.76 (0.9)
  1974. @tab -113.22 (1.4)
  1975. @tab hit
  1976. @item
  1977. s20-2
  1978. @tab 8.0e+04
  1979. @tab +63.48 (2.0)
  1980. @tab +18.05 (1.0)
  1981. @tab +36.30 (2.0)
  1982. @tab stand
  1983. @item
  1984. s20-3
  1985. @tab 8.0e+04
  1986. @tab +64.51 (2.0)
  1987. @tab +19.96 (1.0)
  1988. @tab +41.60 (2.0)
  1989. @tab stand
  1990. @item
  1991. s20-4
  1992. @tab 8.0e+04
  1993. @tab +65.47 (2.0)
  1994. @tab +22.51 (1.0)
  1995. @tab +45.96 (2.0)
  1996. @tab stand
  1997. @item
  1998. s20-5
  1999. @tab 8.0e+04
  2000. @tab +66.59 (2.0)
  2001. @tab +26.19 (1.0)
  2002. @tab +50.69 (2.0)
  2003. @tab stand
  2004. @item
  2005. s20-6
  2006. @tab 8.0e+04
  2007. @tab +68.22 (2.0)
  2008. @tab +28.20 (1.0)
  2009. @tab +56.57 (2.0)
  2010. @tab stand
  2011. @item
  2012. s20-7
  2013. @tab 8.0e+04
  2014. @tab +77.45 (2.0)
  2015. @tab +26.05 (1.0)
  2016. @tab +40.16 (2.0)
  2017. @tab stand
  2018. @item
  2019. s20-8
  2020. @tab 8.0e+04
  2021. @tab +79.03 (2.0)
  2022. @tab +19.32 (1.0)
  2023. @tab +28.44 (2.0)
  2024. @tab stand
  2025. @item
  2026. s20-9
  2027. @tab 8.0e+04
  2028. @tab +76.09 (2.0)
  2029. @tab +11.81 (1.0)
  2030. @tab +15.62 (2.0)
  2031. @tab stand
  2032. @item
  2033. s20-T
  2034. @tab 8.0e+04
  2035. @tab +43.83 (1.9)
  2036. @tab -5.43 (1.0)
  2037. @tab -8.42 (1.9)
  2038. @tab stand
  2039. @item
  2040. s20-A
  2041. @tab 8.0e+04
  2042. @tab +10.71 (1.7)
  2043. @tab -28.46 (1.0)
  2044. @tab -34.57 (1.7)
  2045. @tab stand
  2046. @item
  2047. s19-2
  2048. @tab 8.0e+04
  2049. @tab +37.55 (2.0)
  2050. @tab +12.16 (1.0)
  2051. @tab +23.28 (2.0)
  2052. @tab stand
  2053. @item
  2054. s19-3
  2055. @tab 8.0e+04
  2056. @tab +39.32 (2.0)
  2057. @tab +14.45 (1.0)
  2058. @tab +28.76 (2.0)
  2059. @tab stand
  2060. @item
  2061. s19-4
  2062. @tab 8.0e+04
  2063. @tab +41.67 (2.0)
  2064. @tab +17.97 (1.0)
  2065. @tab +34.49 (2.0)
  2066. @tab stand
  2067. @item
  2068. s19-5
  2069. @tab 3.2e+05
  2070. @tab +43.87 (1.0)
  2071. @tab +20.25 (0.5)
  2072. @tab +39.76 (1.0)
  2073. @tab stand
  2074. @item
  2075. s19-6
  2076. @tab 5.1e+06
  2077. @tab +45.30 (0.2)
  2078. @tab +23.06 (0.1)
  2079. @tab +46.24 (0.2)
  2080. @tab double
  2081. @item
  2082. s19-7
  2083. @tab 8.0e+04
  2084. @tab +62.00 (2.0)
  2085. @tab +22.80 (1.0)
  2086. @tab +32.42 (2.0)
  2087. @tab stand
  2088. @item
  2089. s19-8
  2090. @tab 8.0e+04
  2091. @tab +59.68 (2.0)
  2092. @tab +15.07 (1.0)
  2093. @tab +20.09 (2.0)
  2094. @tab stand
  2095. @item
  2096. s19-9
  2097. @tab 8.0e+04
  2098. @tab +28.83 (2.0)
  2099. @tab +1.29 (1.0)
  2100. @tab -7.06 (2.0)
  2101. @tab stand
  2102. @item
  2103. s19-T
  2104. @tab 8.0e+04
  2105. @tab -1.88 (1.9)
  2106. @tab -15.44 (1.0)
  2107. @tab -29.40 (1.9)
  2108. @tab stand
  2109. @item
  2110. s19-A
  2111. @tab 8.0e+04
  2112. @tab -17.63 (1.7)
  2113. @tab -34.41 (0.9)
  2114. @tab -46.94 (1.7)
  2115. @tab stand
  2116. @item
  2117. s18-2
  2118. @tab 2.0e+07
  2119. @tab +11.01 (0)
  2120. @tab +6.00 (0)
  2121. @tab +11.43 (0)
  2122. @tab double
  2123. @item
  2124. s18-3
  2125. @tab 3.2e+05
  2126. @tab +13.74 (1.0)
  2127. @tab +8.81 (0.5)
  2128. @tab +17.70 (1.0)
  2129. @tab double
  2130. @item
  2131. s18-4
  2132. @tab 8.0e+04
  2133. @tab +16.38 (2.0)
  2134. @tab +12.04 (1.0)
  2135. @tab +22.38 (2.0)
  2136. @tab double
  2137. @item
  2138. s18-5
  2139. @tab 8.0e+04
  2140. @tab +19.67 (2.0)
  2141. @tab +14.12 (1.0)
  2142. @tab +29.11 (2.0)
  2143. @tab double
  2144. @item
  2145. s18-6
  2146. @tab 8.0e+04
  2147. @tab +22.24 (2.0)
  2148. @tab +15.83 (1.0)
  2149. @tab +35.89 (2.0)
  2150. @tab double
  2151. @item
  2152. s18-7
  2153. @tab 8.0e+04
  2154. @tab +39.95 (2.0)
  2155. @tab +17.00 (1.0)
  2156. @tab +21.63 (2.0)
  2157. @tab stand
  2158. @item
  2159. s18-8
  2160. @tab 8.0e+04
  2161. @tab +10.59 (2.0)
  2162. @tab +3.79 (1.0)
  2163. @tab -2.20 (2.0)
  2164. @tab stand
  2165. @item
  2166. s18-9
  2167. @tab 8.0e+04
  2168. @tab -18.25 (2.0)
  2169. @tab -10.19 (1.0)
  2170. @tab -27.83 (2.0)
  2171. @tab hit
  2172. @item
  2173. s18-T
  2174. @tab 8.0e+04
  2175. @tab -23.79 (1.9)
  2176. @tab -20.45 (1.0)
  2177. @tab -38.84 (1.9)
  2178. @tab hit
  2179. @item
  2180. s18-A
  2181. @tab 8.0e+04
  2182. @tab -46.31 (1.7)
  2183. @tab -41.64 (0.9)
  2184. @tab -59.63 (1.7)
  2185. @tab hit
  2186. @item
  2187. s17-2
  2188. @tab 2.0e+07
  2189. @tab -15.67 (0)
  2190. @tab -0.59 (0)
  2191. @tab -0.88 (0)
  2192. @tab hit
  2193. @item
  2194. s17-3
  2195. @tab 3.2e+05
  2196. @tab -12.35 (1.0)
  2197. @tab +2.42 (0.5)
  2198. @tab +5.90 (1.0)
  2199. @tab double
  2200. @item
  2201. s17-4
  2202. @tab 8.0e+04
  2203. @tab -8.13 (2.0)
  2204. @tab +5.14 (1.0)
  2205. @tab +11.54 (2.0)
  2206. @tab double
  2207. @item
  2208. s17-5
  2209. @tab 8.0e+04
  2210. @tab -4.49 (2.0)
  2211. @tab +9.23 (1.0)
  2212. @tab +18.59 (2.0)
  2213. @tab double
  2214. @item
  2215. s17-6
  2216. @tab 8.0e+04
  2217. @tab -0.39 (2.0)
  2218. @tab +10.43 (1.0)
  2219. @tab +25.67 (2.0)
  2220. @tab double
  2221. @item
  2222. s17-7
  2223. @tab 8.0e+04
  2224. @tab -10.70 (2.0)
  2225. @tab +5.76 (1.0)
  2226. @tab -2.08 (2.0)
  2227. @tab hit
  2228. @item
  2229. s17-8
  2230. @tab 8.0e+04
  2231. @tab -37.98 (2.0)
  2232. @tab -7.55 (1.0)
  2233. @tab -24.83 (2.0)
  2234. @tab hit
  2235. @item
  2236. s17-9
  2237. @tab 8.0e+04
  2238. @tab -42.52 (2.0)
  2239. @tab -14.14 (1.0)
  2240. @tab -39.49 (2.0)
  2241. @tab hit
  2242. @item
  2243. s17-T
  2244. @tab 8.0e+04
  2245. @tab -46.49 (1.9)
  2246. @tab -25.88 (1.0)
  2247. @tab -50.28 (1.9)
  2248. @tab hit
  2249. @item
  2250. s17-A
  2251. @tab 8.0e+04
  2252. @tab -66.85 (1.6)
  2253. @tab -46.56 (0.9)
  2254. @tab -68.92 (1.6)
  2255. @tab hit
  2256. @item
  2257. s16-2
  2258. @tab 8.0e+04
  2259. @tab -28.87 (2.1)
  2260. @tab -1.93 (1.0)
  2261. @tab -7.79 (2.1)
  2262. @tab hit
  2263. @item
  2264. s16-3
  2265. @tab 3.2e+05
  2266. @tab -24.68 (1.0)
  2267. @tab +0.27 (0.5)
  2268. @tab -1.15 (1.0)
  2269. @tab hit
  2270. @item
  2271. s16-4
  2272. @tab 3.2e+05
  2273. @tab -20.67 (1.0)
  2274. @tab +3.56 (0.5)
  2275. @tab +5.67 (1.0)
  2276. @tab double
  2277. @item
  2278. s16-5
  2279. @tab 8.0e+04
  2280. @tab -16.41 (2.1)
  2281. @tab +6.62 (1.0)
  2282. @tab +13.59 (2.1)
  2283. @tab double
  2284. @item
  2285. s16-6
  2286. @tab 8.0e+04
  2287. @tab -12.54 (2.1)
  2288. @tab +8.47 (1.0)
  2289. @tab +19.52 (2.1)
  2290. @tab double
  2291. @item
  2292. s16-7
  2293. @tab 8.0e+04
  2294. @tab -47.66 (2.1)
  2295. @tab -0.28 (1.0)
  2296. @tab -17.54 (2.1)
  2297. @tab hit
  2298. @item
  2299. s16-8
  2300. @tab 8.0e+04
  2301. @tab -51.11 (2.0)
  2302. @tab -6.82 (1.0)
  2303. @tab -31.42 (2.0)
  2304. @tab hit
  2305. @item
  2306. s16-9
  2307. @tab 8.0e+04
  2308. @tab -54.37 (2.0)
  2309. @tab -14.60 (1.0)
  2310. @tab -45.25 (2.0)
  2311. @tab hit
  2312. @item
  2313. s16-T
  2314. @tab 8.0e+04
  2315. @tab -57.80 (1.9)
  2316. @tab -26.81 (1.0)
  2317. @tab -55.92 (1.9)
  2318. @tab hit
  2319. @item
  2320. s16-A
  2321. @tab 8.0e+04
  2322. @tab -72.59 (1.6)
  2323. @tab -44.41 (0.9)
  2324. @tab -71.66 (1.6)
  2325. @tab hit
  2326. @item
  2327. s15-2
  2328. @tab 8.0e+04
  2329. @tab -28.34 (2.1)
  2330. @tab -0.67 (1.0)
  2331. @tab -7.00 (2.1)
  2332. @tab hit
  2333. @item
  2334. s15-3
  2335. @tab 8.0e+04
  2336. @tab -24.95 (2.1)
  2337. @tab +2.82 (1.0)
  2338. @tab -0.19 (2.1)
  2339. @tab hit
  2340. @item
  2341. s15-4
  2342. @tab 5.1e+06
  2343. @tab -20.55 (0.3)
  2344. @tab +5.57 (0.1)
  2345. @tab +6.16 (0.3)
  2346. @tab double
  2347. @item
  2348. s15-5
  2349. @tab 8.0e+04
  2350. @tab -16.27 (2.1)
  2351. @tab +8.83 (1.0)
  2352. @tab +13.72 (2.1)
  2353. @tab double
  2354. @item
  2355. s15-6
  2356. @tab 8.0e+04
  2357. @tab -12.97 (2.1)
  2358. @tab +9.96 (1.0)
  2359. @tab +20.24 (2.1)
  2360. @tab double
  2361. @item
  2362. s15-7
  2363. @tab 8.0e+04
  2364. @tab -47.65 (2.1)
  2365. @tab +3.09 (1.0)
  2366. @tab -18.41 (2.1)
  2367. @tab hit
  2368. @item
  2369. s15-8
  2370. @tab 8.0e+04
  2371. @tab -51.20 (2.0)
  2372. @tab -2.86 (1.0)
  2373. @tab -31.79 (2.0)
  2374. @tab hit
  2375. @item
  2376. s15-9
  2377. @tab 8.0e+04
  2378. @tab -55.02 (2.0)
  2379. @tab -11.42 (1.0)
  2380. @tab -46.42 (2.0)
  2381. @tab hit
  2382. @item
  2383. s15-T
  2384. @tab 8.0e+04
  2385. @tab -57.45 (1.9)
  2386. @tab -23.91 (1.0)
  2387. @tab -54.95 (1.9)
  2388. @tab hit
  2389. @item
  2390. s15-A
  2391. @tab 8.0e+04
  2392. @tab -72.00 (1.6)
  2393. @tab -42.42 (0.9)
  2394. @tab -72.09 (1.6)
  2395. @tab hit
  2396. @item
  2397. s14-2
  2398. @tab 8.0e+04
  2399. @tab -28.06 (2.1)
  2400. @tab +1.78 (1.0)
  2401. @tab -6.21 (2.1)
  2402. @tab hit
  2403. @item
  2404. s14-3
  2405. @tab 8.0e+04
  2406. @tab -24.41 (2.1)
  2407. @tab +4.42 (1.0)
  2408. @tab -0.62 (2.1)
  2409. @tab hit
  2410. @item
  2411. s14-4
  2412. @tab 8.0e+04
  2413. @tab -20.41 (2.1)
  2414. @tab +8.31 (1.0)
  2415. @tab +5.82 (2.1)
  2416. @tab hit
  2417. @item
  2418. s14-5
  2419. @tab 3.2e+05
  2420. @tab -16.31 (1.0)
  2421. @tab +10.82 (0.5)
  2422. @tab +12.34 (1.0)
  2423. @tab double
  2424. @item
  2425. s14-6
  2426. @tab 8.0e+04
  2427. @tab -12.35 (2.1)
  2428. @tab +11.90 (1.0)
  2429. @tab +19.57 (2.1)
  2430. @tab double
  2431. @item
  2432. s14-7
  2433. @tab 8.0e+04
  2434. @tab -47.52 (2.0)
  2435. @tab +7.95 (1.0)
  2436. @tab -18.64 (2.0)
  2437. @tab hit
  2438. @item
  2439. s14-8
  2440. @tab 8.0e+04
  2441. @tab -51.41 (2.0)
  2442. @tab +2.01 (1.0)
  2443. @tab -32.23 (2.0)
  2444. @tab hit
  2445. @item
  2446. s14-9
  2447. @tab 8.0e+04
  2448. @tab -54.26 (2.0)
  2449. @tab -7.57 (1.0)
  2450. @tab -45.45 (2.0)
  2451. @tab hit
  2452. @item
  2453. s14-T
  2454. @tab 8.0e+04
  2455. @tab -57.20 (1.9)
  2456. @tab -20.14 (1.0)
  2457. @tab -56.20 (1.9)
  2458. @tab hit
  2459. @item
  2460. s14-A
  2461. @tab 8.0e+04
  2462. @tab -72.41 (1.6)
  2463. @tab -39.75 (0.9)
  2464. @tab -70.94 (1.6)
  2465. @tab hit
  2466. @item
  2467. s13-2
  2468. @tab 8.0e+04
  2469. @tab -28.79 (2.1)
  2470. @tab +4.29 (1.0)
  2471. @tab -7.07 (2.1)
  2472. @tab hit
  2473. @item
  2474. s13-3
  2475. @tab 8.0e+04
  2476. @tab -24.39 (2.1)
  2477. @tab +7.00 (1.0)
  2478. @tab -0.33 (2.1)
  2479. @tab hit
  2480. @item
  2481. s13-4
  2482. @tab 8.0e+04
  2483. @tab -20.39 (2.1)
  2484. @tab +10.23 (1.0)
  2485. @tab +5.20 (2.1)
  2486. @tab hit
  2487. @item
  2488. s13-5
  2489. @tab 2.0e+07
  2490. @tab -16.46 (0)
  2491. @tab +12.88 (0)
  2492. @tab +12.73 (0)
  2493. @tab hit
  2494. @item
  2495. s13-6
  2496. @tab 8.0e+04
  2497. @tab -12.67 (2.1)
  2498. @tab +13.75 (1.0)
  2499. @tab +18.93 (2.1)
  2500. @tab double
  2501. @item
  2502. s13-7
  2503. @tab 8.0e+04
  2504. @tab -47.64 (2.1)
  2505. @tab +12.41 (1.0)
  2506. @tab -18.59 (2.1)
  2507. @tab hit
  2508. @item
  2509. s13-8
  2510. @tab 8.0e+04
  2511. @tab -51.47 (2.0)
  2512. @tab +5.50 (1.0)
  2513. @tab -32.61 (2.0)
  2514. @tab hit
  2515. @item
  2516. s13-9
  2517. @tab 8.0e+04
  2518. @tab -54.33 (2.0)
  2519. @tab -3.30 (1.0)
  2520. @tab -45.89 (2.0)
  2521. @tab hit
  2522. @item
  2523. s13-T
  2524. @tab 8.0e+04
  2525. @tab -57.17 (1.9)
  2526. @tab -17.29 (1.0)
  2527. @tab -55.28 (1.9)
  2528. @tab hit
  2529. @item
  2530. s13-A
  2531. @tab 8.0e+04
  2532. @tab -71.95 (1.6)
  2533. @tab -37.21 (0.9)
  2534. @tab -72.33 (1.6)
  2535. @tab hit
  2536. @item
  2537. s12-2
  2538. @tab 8.0e+04
  2539. @tab -28.81 (2.1)
  2540. @tab +7.24 (1.0)
  2541. @tab -5.99 (2.1)
  2542. @tab hit
  2543. @item
  2544. s12-3
  2545. @tab 8.0e+04
  2546. @tab -24.61 (2.1)
  2547. @tab +9.89 (1.0)
  2548. @tab -0.34 (2.1)
  2549. @tab hit
  2550. @item
  2551. s12-4
  2552. @tab 8.0e+04
  2553. @tab -20.33 (2.1)
  2554. @tab +12.28 (1.0)
  2555. @tab +6.36 (2.1)
  2556. @tab hit
  2557. @item
  2558. s12-5
  2559. @tab 8.0e+04
  2560. @tab -16.22 (2.1)
  2561. @tab +15.13 (1.0)
  2562. @tab +12.78 (2.1)
  2563. @tab hit
  2564. @item
  2565. s12-6
  2566. @tab 8.0e+04
  2567. @tab -12.16 (2.1)
  2568. @tab +15.30 (1.0)
  2569. @tab +21.02 (2.1)
  2570. @tab double
  2571. @item
  2572. s12-7
  2573. @tab 8.0e+04
  2574. @tab -46.97 (2.1)
  2575. @tab +16.64 (1.0)
  2576. @tab -18.22 (2.1)
  2577. @tab hit
  2578. @item
  2579. s12-8
  2580. @tab 8.0e+04
  2581. @tab -50.98 (2.0)
  2582. @tab +9.38 (1.0)
  2583. @tab -31.23 (2.0)
  2584. @tab hit
  2585. @item
  2586. s12-9
  2587. @tab 8.0e+04
  2588. @tab -54.01 (2.0)
  2589. @tab +0.31 (1.0)
  2590. @tab -45.30 (2.0)
  2591. @tab hit
  2592. @item
  2593. s12-T
  2594. @tab 8.0e+04
  2595. @tab -58.03 (1.9)
  2596. @tab -14.72 (1.0)
  2597. @tab -56.96 (1.9)
  2598. @tab hit
  2599. @item
  2600. s12-A
  2601. @tab 8.0e+04
  2602. @tab -72.15 (1.6)
  2603. @tab -35.17 (0.9)
  2604. @tab -72.39 (1.6)
  2605. @tab hit
  2606. @end multitable
  2607. @multitable {p2-A} {Hands needed} {-67.42 (1.5)} {-51.15 (0.9)}
  2608. @headitem
  2609. Hand
  2610. @tab Hands needed
  2611. @tab Yes [%]
  2612. @tab No [%]
  2613. @item
  2614. pA-2
  2615. @tab 8.0e+04
  2616. @tab +47.79 (1.7)
  2617. @tab +7.70 (1.0)
  2618. @item
  2619. pA-3
  2620. @tab 8.0e+04
  2621. @tab +51.89 (1.7)
  2622. @tab +9.80 (1.0)
  2623. @item
  2624. pA-4
  2625. @tab 8.0e+04
  2626. @tab +56.73 (1.7)
  2627. @tab +11.81 (1.0)
  2628. @item
  2629. pA-5
  2630. @tab 8.0e+04
  2631. @tab +61.10 (1.7)
  2632. @tab +15.76 (1.0)
  2633. @item
  2634. pA-6
  2635. @tab 8.0e+04
  2636. @tab +66.09 (1.7)
  2637. @tab +20.40 (2.1)
  2638. @item
  2639. pA-7
  2640. @tab 8.0e+04
  2641. @tab +46.61 (1.6)
  2642. @tab +15.82 (1.0)
  2643. @item
  2644. pA-8
  2645. @tab 8.0e+04
  2646. @tab +35.34 (1.6)
  2647. @tab +9.87 (1.0)
  2648. @item
  2649. pA-9
  2650. @tab 8.0e+04
  2651. @tab +23.05 (1.6)
  2652. @tab -0.13 (1.0)
  2653. @item
  2654. pA-T
  2655. @tab 8.0e+04
  2656. @tab +8.79 (1.6)
  2657. @tab -14.01 (1.0)
  2658. @item
  2659. pA-A
  2660. @tab 8.0e+04
  2661. @tab -24.16 (1.5)
  2662. @tab -35.35 (0.9)
  2663. @item
  2664. pT-2
  2665. @tab 8.0e+04
  2666. @tab -4.29 (3.7)
  2667. @tab +63.29 (0.7)
  2668. @item
  2669. pT-3
  2670. @tab 8.0e+04
  2671. @tab +4.76 (3.8)
  2672. @tab +64.28 (0.7)
  2673. @item
  2674. pT-4
  2675. @tab 8.0e+04
  2676. @tab +15.42 (4.0)
  2677. @tab +65.64 (0.7)
  2678. @item
  2679. pT-5
  2680. @tab 8.0e+04
  2681. @tab +27.51 (4.1)
  2682. @tab +66.77 (0.7)
  2683. @item
  2684. pT-6
  2685. @tab 8.0e+04
  2686. @tab +37.88 (4.1)
  2687. @tab +67.89 (0.7)
  2688. @item
  2689. pT-7
  2690. @tab 8.0e+04
  2691. @tab +8.98 (2.6)
  2692. @tab +77.52 (0.6)
  2693. @item
  2694. pT-8
  2695. @tab 8.0e+04
  2696. @tab -22.83 (2.5)
  2697. @tab +79.04 (0.6)
  2698. @item
  2699. pT-9
  2700. @tab 8.0e+04
  2701. @tab -61.33 (2.6)
  2702. @tab +76.23 (0.6)
  2703. @item
  2704. pT-T
  2705. @tab 8.0e+04
  2706. @tab -76.47 (2.7)
  2707. @tab +43.58 (0.7)
  2708. @item
  2709. pT-A
  2710. @tab 8.0e+04
  2711. @tab -85.74 (2.2)
  2712. @tab +11.11 (1.0)
  2713. @item
  2714. p9-2
  2715. @tab 8.0e+04
  2716. @tab +20.25 (2.2)
  2717. @tab +10.96 (1.0)
  2718. @item
  2719. p9-3
  2720. @tab 8.0e+04
  2721. @tab +25.62 (2.2)
  2722. @tab +13.70 (1.0)
  2723. @item
  2724. p9-4
  2725. @tab 8.0e+04
  2726. @tab +32.53 (2.2)
  2727. @tab +16.16 (1.0)
  2728. @item
  2729. p9-5
  2730. @tab 8.0e+04
  2731. @tab +39.22 (2.2)
  2732. @tab +19.08 (1.0)
  2733. @item
  2734. p9-6
  2735. @tab 8.0e+04
  2736. @tab +47.19 (2.2)
  2737. @tab +22.75 (1.0)
  2738. @item
  2739. p9-7
  2740. @tab 3.2e+05
  2741. @tab +36.59 (0.9)
  2742. @tab +40.03 (0.4)
  2743. @item
  2744. p9-8
  2745. @tab 8.0e+04
  2746. @tab +23.50 (1.9)
  2747. @tab +10.05 (0.8)
  2748. @item
  2749. p9-9
  2750. @tab 8.0e+04
  2751. @tab -8.46 (1.8)
  2752. @tab -18.37 (1.0)
  2753. @item
  2754. p9-T
  2755. @tab 8.0e+04
  2756. @tab -36.82 (1.9)
  2757. @tab -23.97 (1.0)
  2758. @item
  2759. p9-A
  2760. @tab 3.2e+05
  2761. @tab -48.36 (0.8)
  2762. @tab -46.75 (0.4)
  2763. @item
  2764. p8-2
  2765. @tab 8.0e+04
  2766. @tab +7.89 (2.4)
  2767. @tab -29.06 (1.0)
  2768. @item
  2769. p8-3
  2770. @tab 8.0e+04
  2771. @tab +14.84 (2.4)
  2772. @tab -23.82 (1.0)
  2773. @item
  2774. p8-4
  2775. @tab 8.0e+04
  2776. @tab +21.02 (2.5)
  2777. @tab -20.67 (1.0)
  2778. @item
  2779. p8-5
  2780. @tab 8.0e+04
  2781. @tab +29.77 (2.5)
  2782. @tab -16.36 (1.0)
  2783. @item
  2784. p8-6
  2785. @tab 8.0e+04
  2786. @tab +39.44 (2.7)
  2787. @tab -11.93 (1.1)
  2788. @item
  2789. p8-7
  2790. @tab 8.0e+04
  2791. @tab +31.80 (2.1)
  2792. @tab -41.83 (0.9)
  2793. @item
  2794. p8-8
  2795. @tab 8.0e+04
  2796. @tab -2.54 (2.1)
  2797. @tab -45.57 (0.9)
  2798. @item
  2799. p8-9
  2800. @tab 8.0e+04
  2801. @tab -39.27 (2.2)
  2802. @tab -50.67 (0.9)
  2803. @item
  2804. p8-T
  2805. @tab 8.0e+04
  2806. @tab -51.15 (1.9)
  2807. @tab -57.31 (0.8)
  2808. @item
  2809. p8-A
  2810. @tab 3.2e+05
  2811. @tab -66.55 (0.8)
  2812. @tab -68.39 (0.4)
  2813. @item
  2814. p7-2
  2815. @tab 8.0e+04
  2816. @tab -12.93 (2.6)
  2817. @tab -28.38 (1.0)
  2818. @item
  2819. p7-3
  2820. @tab 8.0e+04
  2821. @tab -5.76 (2.8)
  2822. @tab -24.45 (1.0)
  2823. @item
  2824. p7-4
  2825. @tab 8.0e+04
  2826. @tab +7.32 (2.9)
  2827. @tab -21.06 (1.0)
  2828. @item
  2829. p7-5
  2830. @tab 8.0e+04
  2831. @tab +16.33 (2.9)
  2832. @tab -16.50 (1.0)
  2833. @item
  2834. p7-6
  2835. @tab 8.0e+04
  2836. @tab +24.66 (2.9)
  2837. @tab -12.31 (1.1)
  2838. @item
  2839. p7-7
  2840. @tab 8.0e+04
  2841. @tab -4.49 (2.1)
  2842. @tab -31.70 (1.0)
  2843. @item
  2844. p7-8
  2845. @tab 3.2e+05
  2846. @tab -39.47 (1.0)
  2847. @tab -36.94 (0.5)
  2848. @item
  2849. p7-9
  2850. @tab 8.0e+04
  2851. @tab -57.27 (2.1)
  2852. @tab -43.25 (0.9)
  2853. @item
  2854. p7-T
  2855. @tab 8.0e+04
  2856. @tab -68.16 (1.8)
  2857. @tab -51.02 (0.9)
  2858. @item
  2859. p7-A
  2860. @tab 8.0e+04
  2861. @tab -81.66 (1.6)
  2862. @tab -62.96 (0.8)
  2863. @item
  2864. p6-2
  2865. @tab 8.0e+04
  2866. @tab -20.02 (2.5)
  2867. @tab -24.94 (1.0)
  2868. @item
  2869. p6-3
  2870. @tab 8.0e+04
  2871. @tab -13.43 (2.9)
  2872. @tab -22.86 (1.0)
  2873. @item
  2874. p6-4
  2875. @tab 8.0e+04
  2876. @tab -1.32 (2.9)
  2877. @tab -20.97 (1.0)
  2878. @item
  2879. p6-5
  2880. @tab 8.0e+04
  2881. @tab +8.77 (2.9)
  2882. @tab -16.47 (1.0)
  2883. @item
  2884. p6-6
  2885. @tab 8.0e+04
  2886. @tab +18.02 (2.9)
  2887. @tab -11.89 (1.1)
  2888. @item
  2889. p6-7
  2890. @tab 8.0e+04
  2891. @tab -25.77 (2.0)
  2892. @tab -21.03 (1.0)
  2893. @item
  2894. p6-8
  2895. @tab 8.0e+04
  2896. @tab -42.37 (2.0)
  2897. @tab -26.97 (1.0)
  2898. @item
  2899. p6-9
  2900. @tab 8.0e+04
  2901. @tab -61.32 (1.9)
  2902. @tab -33.82 (1.0)
  2903. @item
  2904. p6-T
  2905. @tab 8.0e+04
  2906. @tab -73.60 (1.7)
  2907. @tab -42.98 (0.9)
  2908. @item
  2909. p6-A
  2910. @tab 8.0e+04
  2911. @tab -81.35 (1.5)
  2912. @tab -57.46 (0.8)
  2913. @item
  2914. p5-2
  2915. @tab 8.0e+04
  2916. @tab -29.29 (2.3)
  2917. @tab +35.74 (2.0)
  2918. @item
  2919. p5-3
  2920. @tab 8.0e+04
  2921. @tab -21.10 (2.5)
  2922. @tab +40.83 (2.0)
  2923. @item
  2924. p5-4
  2925. @tab 8.0e+04
  2926. @tab -14.02 (2.8)
  2927. @tab +46.13 (2.0)
  2928. @item
  2929. p5-5
  2930. @tab 8.0e+04
  2931. @tab -2.07 (2.8)
  2932. @tab +51.38 (2.0)
  2933. @item
  2934. p5-6
  2935. @tab 8.0e+04
  2936. @tab +7.69 (2.8)
  2937. @tab +55.49 (2.0)
  2938. @item
  2939. p5-7
  2940. @tab 8.0e+04
  2941. @tab -29.78 (1.8)
  2942. @tab +38.74 (2.0)
  2943. @item
  2944. p5-8
  2945. @tab 8.0e+04
  2946. @tab -45.59 (1.8)
  2947. @tab +29.74 (2.0)
  2948. @item
  2949. p5-9
  2950. @tab 8.0e+04
  2951. @tab -63.38 (1.7)
  2952. @tab +15.31 (2.0)
  2953. @item
  2954. p5-T
  2955. @tab 8.0e+04
  2956. @tab -75.56 (1.7)
  2957. @tab -5.45 (1.0)
  2958. @item
  2959. p5-A
  2960. @tab 8.0e+04
  2961. @tab -83.48 (1.4)
  2962. @tab -28.71 (1.0)
  2963. @item
  2964. p4-2
  2965. @tab 8.0e+04
  2966. @tab -18.34 (2.4)
  2967. @tab -2.08 (1.0)
  2968. @item
  2969. p4-3
  2970. @tab 8.0e+04
  2971. @tab -10.15 (2.7)
  2972. @tab -0.10 (1.0)
  2973. @item
  2974. p4-4
  2975. @tab 8.0e+04
  2976. @tab -1.53 (2.9)
  2977. @tab +4.20 (1.0)
  2978. @item
  2979. p4-5
  2980. @tab 1.3e+06
  2981. @tab +8.32 (0.7)
  2982. @tab +6.94 (0.3)
  2983. @item
  2984. p4-6
  2985. @tab 8.0e+04
  2986. @tab +18.54 (2.9)
  2987. @tab +9.10 (1.0)
  2988. @item
  2989. p4-7
  2990. @tab 8.0e+04
  2991. @tab -17.13 (2.0)
  2992. @tab +8.29 (1.0)
  2993. @item
  2994. p4-8
  2995. @tab 8.0e+04
  2996. @tab -32.41 (2.0)
  2997. @tab -5.80 (1.0)
  2998. @item
  2999. p4-9
  3000. @tab 8.0e+04
  3001. @tab -52.03 (2.0)
  3002. @tab -21.40 (1.0)
  3003. @item
  3004. p4-T
  3005. @tab 8.0e+04
  3006. @tab -65.35 (1.7)
  3007. @tab -30.80 (1.0)
  3008. @item
  3009. p4-A
  3010. @tab 8.0e+04
  3011. @tab -75.64 (1.5)
  3012. @tab -48.85 (0.9)
  3013. @item
  3014. p3-2
  3015. @tab 2.0e+07
  3016. @tab -13.55 (0)
  3017. @tab -13.84 (0)
  3018. @item
  3019. p3-3
  3020. @tab 3.2e+05
  3021. @tab -4.62 (1.3)
  3022. @tab -10.55 (0.5)
  3023. @item
  3024. p3-4
  3025. @tab 8.0e+04
  3026. @tab +4.29 (2.7)
  3027. @tab -7.50 (1.0)
  3028. @item
  3029. p3-5
  3030. @tab 8.0e+04
  3031. @tab +12.98 (2.9)
  3032. @tab -2.79 (1.0)
  3033. @item
  3034. p3-6
  3035. @tab 8.0e+04
  3036. @tab +22.13 (2.9)
  3037. @tab +0.27 (1.0)
  3038. @item
  3039. p3-7
  3040. @tab 8.0e+04
  3041. @tab -5.64 (2.0)
  3042. @tab -14.75 (1.0)
  3043. @item
  3044. p3-8
  3045. @tab 3.2e+05
  3046. @tab -23.16 (1.0)
  3047. @tab -21.60 (0.5)
  3048. @item
  3049. p3-9
  3050. @tab 8.0e+04
  3051. @tab -43.38 (2.0)
  3052. @tab -29.61 (1.0)
  3053. @item
  3054. p3-T
  3055. @tab 8.0e+04
  3056. @tab -59.02 (1.7)
  3057. @tab -38.86 (0.9)
  3058. @item
  3059. p3-A
  3060. @tab 8.0e+04
  3061. @tab -70.21 (1.5)
  3062. @tab -54.10 (0.9)
  3063. @item
  3064. p2-2
  3065. @tab 8.0e+04
  3066. @tab -7.83 (2.3)
  3067. @tab -11.55 (1.0)
  3068. @item
  3069. p2-3
  3070. @tab 8.0e+04
  3071. @tab -1.63 (2.5)
  3072. @tab -8.20 (1.0)
  3073. @item
  3074. p2-4
  3075. @tab 8.0e+04
  3076. @tab +5.17 (2.7)
  3077. @tab -4.49 (1.0)
  3078. @item
  3079. p2-5
  3080. @tab 8.0e+04
  3081. @tab +16.51 (2.7)
  3082. @tab -1.33 (1.0)
  3083. @item
  3084. p2-6
  3085. @tab 8.0e+04
  3086. @tab +25.65 (2.9)
  3087. @tab +2.57 (1.0)
  3088. @item
  3089. p2-7
  3090. @tab 8.0e+04
  3091. @tab +0.70 (2.0)
  3092. @tab -8.63 (1.0)
  3093. @item
  3094. p2-8
  3095. @tab 1.3e+06
  3096. @tab -17.84 (0.5)
  3097. @tab -15.96 (0.2)
  3098. @item
  3099. p2-9
  3100. @tab 8.0e+04
  3101. @tab -40.15 (2.0)
  3102. @tab -23.95 (1.0)
  3103. @item
  3104. p2-T
  3105. @tab 8.0e+04
  3106. @tab -53.36 (1.8)
  3107. @tab -34.25 (0.9)
  3108. @item
  3109. p2-A
  3110. @tab 8.0e+04
  3111. @tab -67.42 (1.5)
  3112. @tab -51.15 (0.9)
  3113. @end multitable
  3114. @node Detailed explanation
  3115. @subsection Detailed explanation
  3116. @anchor{#detailed-explanation}
  3117. We want to derive the basic strategy from scratch, i.e.@ without making
  3118. any assumption. What we are going to do is to play a large (more on what
  3119. @emph{large} means below) number of hands by fixing our first two cards
  3120. and the dealer upcard and sequentially standing, doubling or hitting the
  3121. first card. Then we will compare the results for the three cases and
  3122. select as the proper strategy the best one of the three possible
  3123. choices.
  3124. Standing and doubling are easy plays, because after we stand or double
  3125. down then the dealer plays accordingly to the rules: she hits until
  3126. seventeen, possibly hitting soft seventeen. But if we hit on our hand,
  3127. we might need to make another decision whether to stand or hit again. As
  3128. we do not want to assume anything, we have to play in such an order that
  3129. if we do need to make another decision, we already know which is the
  3130. best one.
  3131. @menu
  3132. * Hard hands::
  3133. * Soft hands::
  3134. * Pairs::
  3135. * Number of hands::
  3136. @end menu
  3137. @node Hard hands
  3138. @subsubsection Hard hands
  3139. @anchor{#hard-hands}
  3140. So we start by arranging the shoe so that the user gets hard twenty
  3141. (i.e.@ two faces) and the dealer gets successively upcards of two to
  3142. ace. So we play each combination of dealer upcard (ten) three times each
  3143. playing either
  3144. @enumerate
  3145. @item
  3146. always standing
  3147. @item
  3148. always doubling
  3149. @item
  3150. always hitting
  3151. @end enumerate
  3152. In general the first two plays are easy, because the game stops either
  3153. after standing or after receiving only one card. The last one might lead
  3154. to further hitting, but since we are starting with a hard twenty, that
  3155. would either give the player twenty one or a bust. In any case, the game
  3156. also ends. So we play a certain number of hands (say one thousand hands)
  3157. each of these three plays for each of the ten upcard faces and record
  3158. the outcome. The correct play for hard twenty against each of the ten
  3159. upcards is the play that gave the better result, which is of course
  3160. standing.
  3161. Next, we do the same for a hard nineteen. In this case, the hitting play
  3162. might not end after one card is drawn (i.e.@ we hit on nineteen and get
  3163. and ace). But if that was the case, we would already know what the best
  3164. play is from the previous step so we play accordingly and we stand.
  3165. Repeating this procedure down to hard four we can build the basic
  3166. strategy table for any hard total against any dealer upcard.
  3167. @node Soft hands
  3168. @subsubsection Soft hands
  3169. @anchor{#soft-hands}
  3170. We can now switch to analyze soft hands. Starting from soft twenty
  3171. (i.e.@ an ace and a nine) we do the same we did for the hard case. The
  3172. only difference is that when hitting, we might end either in another
  3173. soft hand which we would already analyzed because we start from twenty
  3174. and go down, or in a hard hand, which we also already analyzed so we can
  3175. play accordingly.
  3176. @node Pairs
  3177. @subsubsection Pairs
  3178. @anchor{#pairs}
  3179. When dealing with pairs, we have to decide whether to split or not. When
  3180. we do not split, we end up in one of the already-analyzed cases: either
  3181. a soft twelve of any even hard hand. When we split, we might end in a
  3182. hard or soft hand (already analyzed) or in a new pair. But since the new
  3183. pair can be only the same pair we are analyzing, we have to treat it
  3184. like we treated the first pair: either to split it or not, so we know
  3185. how to deal with it.
  3186. @node Number of hands
  3187. @subsubsection Number of hands
  3188. @anchor{#number-of-hands}
  3189. The output is the expected value@ @math{e} of the bankroll, which is a
  3190. random variable with an associated uncertainty@ @math{\Delta e} (i.e.@ a
  3191. certain numbers of standard deviations). For example, if we received
  3192. only blackjacks, the expected value would be 1.5 (provided blackjacks
  3193. pay@ 3 to@ 2 of course). If we busted all of our hands without doubling
  3194. or splitting, the expected value would be -1. In order to say that the
  3195. best strategy is, let's say stand and not hitting or doubling down, we
  3196. have to make sure that @math{e_h-\Delta e_h > e_s+\Delta e_s} and
  3197. @math{e_h-\Delta e_h > e_d+\Delta e_d}. If there is no play that can
  3198. give a better expected value than the other two taking into account the
  3199. uncertainties, then we have to play more hands in order to reduce the
  3200. random uncertainty.
  3201. @node Implementation
  3202. @subsection Implementation
  3203. @anchor{#implementation}
  3204. The steps above can be written in a
  3205. @uref{https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29,Bash} script
  3206. that
  3207. @itemize
  3208. @item
  3209. loops over hands and upcards,
  3210. @item
  3211. creates a strategy file for each possible play hit, double or stand (or
  3212. split or not),
  3213. @item
  3214. runs @uref{https://www.seamplex.com/blackjack,Libre@ Blackjack},
  3215. @item
  3216. checks the results and picks the best play,
  3217. @item
  3218. updates the strategy file
  3219. @end itemize
  3220. @verbatim
  3221. ##!/bin/bash
  3222. n0=80000
  3223. n_max=9000000
  3224. RED="\033[0;31m"
  3225. GREEN="\033[0;32m"
  3226. BROWN="\033[0;33m"
  3227. MAGENTA="\e[0;35m"
  3228. CYAN="\e[0;36m"
  3229. NC="\033[0m" ## No Color
  3230. for i in grep awk printf blackjack; do
  3231. if [ -z "$(which $i)" ]; then
  3232. echo "error: $i not installed"
  3233. exit 1
  3234. fi
  3235. done
  3236. debug=0
  3237. declare -A strategy
  3238. declare -A ev
  3239. declare -A min
  3240. min["hard"]=4 ## from 20 to 4 in hards
  3241. min["soft"]=12 ## from 20 to 12 in softs
  3242. rm -f table.md hard.html soft.html pair.html
  3243. ## --------------------------------------------------------------
  3244. ## start with standing
  3245. cp hard-stand.txt hard.txt
  3246. cp soft-stand.txt soft.txt
  3247. cat << EOF >> table.md
  3248. | Hand | \$n\$ | Stand [%] | Double [%] | Hit [%] | Play |
  3249. |:------:|:-----:|:-----------:|:------------:|:--------:|:---------:|
  3250. EOF
  3251. for type in hard soft; do
  3252. for hand in $(seq 20 -1 ${min[${type}]}); do
  3253. ## choose two random cards that make up the player's assumed total
  3254. if [ ${type} = "hard" ]; then
  3255. t="h"
  3256. card1=11
  3257. card2=11
  3258. while test $card1 -gt 10 -o $card2 -gt 10; do
  3259. card1=$((${RANDOM} % (${hand}-3) + 2))
  3260. card2=$((${hand} - ${card1}))
  3261. done
  3262. elif [ ${type} = "soft" ]; then
  3263. t="s"
  3264. ## one card is an ace
  3265. card1=1
  3266. card2=$((${hand} - 10 - ${card1}))
  3267. fi
  3268. cat << EOF >> ${type}.html
  3269. <tr>
  3270. <td>${t}${hand}</td>
  3271. <td>
  3272. <div class="text-right">s<span class="d-none d-lg-inline">tand</span></div>
  3273. <div class="text-right">h<span class="d-none d-lg-inline">it</span></div>
  3274. <div class="text-right">d<span class="d-none d-lg-inline">ouble</span></div>
  3275. </td>
  3276. EOF
  3277. for upcard in $(seq 2 9) T A; do
  3278. if [ "x$upcard" = "xT" ]; then
  3279. upcard_n=10
  3280. elif [ "x$upcard" = "xA" ]; then
  3281. upcard_n=1
  3282. else
  3283. upcard_n=$(($upcard))
  3284. fi
  3285. n=${n0} ## start with n0 hands
  3286. best="x" ## x means don't know what to so, so play
  3287. while [ "${best}" = "x" ]; do
  3288. ## tell the user which combination we are trying and how many we will play
  3289. echo -ne "${t}${hand}-${upcard} ($card1 $card2)\t"$(printf %.1e ${n})
  3290. for play in s d h; do
  3291. ## start with options.conf as a template and add some custom stuff
  3292. cp options.conf blackjack.conf
  3293. cat << EOF >> blackjack.conf
  3294. hands = ${n}
  3295. player = internal
  3296. arranged_cards = ${card1}, $((${upcard_n} + 13)), $((${card2} + 26))
  3297. report = ${t}${hand}-${upcard}-${play}.yaml
  3298. ##log = ${t}${hand}-${upcard}-${play}.log
  3299. EOF
  3300. ## read the current strategy
  3301. while read w p2 p3 p4 p5 p6 p7 p8 p9 pT pA; do
  3302. ## w already has the "h" or the "s"
  3303. strategy[${w},2]=$p2
  3304. strategy[${w},3]=$p3
  3305. strategy[${w},4]=$p4
  3306. strategy[${w},5]=$p5
  3307. strategy[${w},6]=$p6
  3308. strategy[${w},7]=$p7
  3309. strategy[${w},8]=$p8
  3310. strategy[${w},9]=$p9
  3311. strategy[${w},T]=$pT
  3312. strategy[${w},A]=$pA
  3313. done < ${type}.txt
  3314. ## override the read strategy with the explicit play: s, d or h
  3315. strategy[${t}${hand},${upcard}]=${play}
  3316. ## save the new (temporary) strategy
  3317. rm -f ${type}.txt
  3318. for h in $(seq 20 -1 ${min[${type}]}); do
  3319. echo -n "${t}${h} " >> ${type}.txt
  3320. ## extra space if h < 10
  3321. if [ ${h} -lt 10 ]; then
  3322. echo -n " " >> ${type}.txt
  3323. fi
  3324. for u in $(seq 2 9) T A; do
  3325. echo -n "${strategy[${t}${h},${u}]} " >> ${type}.txt
  3326. done
  3327. echo >> ${type}.txt
  3328. done
  3329. ## debug, comment for production
  3330. if [ "${debug}" != "0" ]; then
  3331. cp ${type}.txt ${t}${hand}-${upcard}-${play}.str
  3332. fi
  3333. ## ensamble the full bs.txt with no pairing
  3334. cat hard.txt soft.txt pair-no.txt > bs.txt
  3335. ## play!
  3336. blackjack
  3337. ## evaluate the results
  3338. ev[${t}${hand},${upcard},${play}]=$(grep mean ${t}${hand}-${upcard}-${play}.yaml | awk '{printf("%g", $2)}')
  3339. error[${t}${hand},${upcard},${play}]=$(grep error ${t}${hand}-${upcard}-${play}.yaml | awk '{printf("%g", $2)}')
  3340. done
  3341. ## choose the best one
  3342. ev_s=$(echo ${ev[${t}${hand},${upcard},s]} | awk '{printf("%+.2f", 100*$1)}')
  3343. ev_d=$(echo ${ev[${t}${hand},${upcard},d]} | awk '{printf("%+.2f", 100*$1)}')
  3344. ev_h=$(echo ${ev[${t}${hand},${upcard},h]} | awk '{printf("%+.2f", 100*$1)}')
  3345. if [ ${n} -le ${n_max} ]; then
  3346. ## if we still have room, take into account errors
  3347. error_s=$(echo ${error[${t}${hand},${upcard},s]} | awk '{printf("%.1f", 100*$1)}')
  3348. error_d=$(echo ${error[${t}${hand},${upcard},d]} | awk '{printf("%.1f", 100*$1)}')
  3349. error_h=$(echo ${error[${t}${hand},${upcard},h]} | awk '{printf("%.1f", 100*$1)}')
  3350. else
  3351. ## instead of running infinite hands, above a threshold asume errors are zero
  3352. error_s=0
  3353. error_d=0
  3354. error_h=0
  3355. fi
  3356. echo -ne "\t${ev_s}\t(${error_s})"
  3357. echo -ne "\t${ev_d}\t(${error_d})"
  3358. echo -ne "\t${ev_h}\t(${error_h})"
  3359. if (( $(echo ${ev_s} ${error_s} ${ev_d} ${error_d} | awk '{print (($1-$2) > ($3+$4))}') )) &&
  3360. (( $(echo ${ev_s} ${error_s} ${ev_h} ${error_h} | awk '{print (($1-$2) > ($3+$4))}') )); then
  3361. best="s"
  3362. color=${BROWN}
  3363. best_string="stand"
  3364. elif (( $(echo ${ev_d} ${error_d} ${ev_s} ${error_s} | awk '{print (($1-$2) > ($3+$4))}') )) &&
  3365. (( $(echo ${ev_d} ${error_d} ${ev_h} ${error_h} | awk '{print (($1-$2) > ($3+$4))}') )); then
  3366. best="d"
  3367. color=${CYAN}
  3368. best_string="double"
  3369. elif (( $(echo ${ev_h}-${error_h} ${ev_s} ${error_s} | awk '{print (($1-$2) > ($3+$4))}') )) &&
  3370. (( $(echo ${ev_h}-${error_h} ${ev_d} ${error_d} | awk '{print (($1-$2) > ($3+$4))}') )); then
  3371. best="h"
  3372. color=${MAGENTA}
  3373. best_string="hit"
  3374. else
  3375. best="x"
  3376. color=${NC}
  3377. best_string="uncertain"
  3378. n=$((${n} * 4))
  3379. fi
  3380. echo -e ${color}"\t"${best_string}${NC}
  3381. done
  3382. strategy[${t}${hand},${upcard}]=${best}
  3383. echo "| ${t}${hand}-${upcard} | $(printf %.1e ${n}) | ${ev_s} (${error_s}) | ${ev_h} (${error_h}) | ${ev_d} (${error_d}) | ${best_string} | " >> table.md
  3384. echo " <!-- ${upcard} -->" >> ${type}.html
  3385. echo " <td>" >> ${type}.html
  3386. echo ${ev_s} ${error_s} | awk -f html_cell.awk >> ${type}.html
  3387. echo ${ev_h} ${error_h} | awk -f html_cell.awk >> ${type}.html
  3388. echo ${ev_d} ${error_d} | awk -f html_cell.awk >> ${type}.html
  3389. echo " </td>" >> ${type}.html
  3390. ## save the strategy again with the best strategy
  3391. rm -f ${type}.txt
  3392. for h in $(seq 20 -1 ${min[${type}]}); do
  3393. echo -n "${t}${h} " >> ${type}.txt
  3394. ## extra space if h < 10
  3395. if [ ${h} -lt 10 ]; then
  3396. echo -n " " >> ${type}.txt
  3397. fi
  3398. for u in $(seq 2 9) T A; do
  3399. echo -n "${strategy[${t}${h},${u}]} " >> ${type}.txt
  3400. done
  3401. echo >> ${type}.txt
  3402. done
  3403. done
  3404. ## echo "</tr>" >> ${type}.html
  3405. done
  3406. done
  3407. cat << EOF >> table.md
  3408. | Hand | \$n\$ | Yes [%] | No [%] |
  3409. |:------:|:-------:|:----------:|:----------:|
  3410. EOF
  3411. ## --------------------------------------------------------------------
  3412. ## pairs
  3413. type="pair"
  3414. t="p"
  3415. cp pair-no.txt pair.txt
  3416. for hand in A T $(seq 9 -1 2); do
  3417. if [ "${hand}" = "A" ]; then
  3418. pair=1
  3419. elif [ "${hand}" = "T" ]; then
  3420. pair=10
  3421. else
  3422. pair=$((${hand}))
  3423. fi
  3424. ## cat << EOF >> ${type}.html
  3425. ## <tr>
  3426. ## <td>${t}${hand}</td>
  3427. ## <td>
  3428. ## <div class="text-right">y<span class="d-none d-lg-inline">es</span></div>
  3429. ## <div class="text-right">n<span class="d-none d-lg-inline">o</span></div>
  3430. ## </td>
  3431. ## EOF
  3432. for upcard in $(seq 2 9) T A; do
  3433. if [ "$upcard" = "T" ]; then
  3434. upcard_n=10
  3435. elif [ "$upcard" = "A" ]; then
  3436. upcard_n=1
  3437. else
  3438. upcard_n=$(($upcard))
  3439. fi
  3440. n=${n0} ## start with n0 hands
  3441. best="x" ## x means don't know what to so, so play
  3442. while [ "${best}" = "x" ]; do
  3443. ## tell the user which combination we are trying and how many we will play
  3444. echo -ne "${t}${hand}-${upcard}\t\t$(printf %.0e ${n})"
  3445. for play in y n; do
  3446. ## start with options.conf as a template and add some custom stuff
  3447. cp options.conf blackjack.conf
  3448. cat << EOF >> blackjack.conf
  3449. hands = ${n}
  3450. player = internal
  3451. arranged_cards = ${pair}, $((${upcard_n} + 13)), $((${pair} + 26))
  3452. report = ${t}${hand}-${upcard}-${play}.yaml
  3453. ## log = ${t}${hand}-${upcard}-${play}.log
  3454. EOF
  3455. ## read the current strategy
  3456. while read w p2 p3 p4 p5 p6 p7 p8 p9 pT pA; do
  3457. ## w already has the "p"
  3458. strategy[${w},2]=$p2
  3459. strategy[${w},3]=$p3
  3460. strategy[${w},4]=$p4
  3461. strategy[${w},5]=$p5
  3462. strategy[${w},6]=$p6
  3463. strategy[${w},7]=$p7
  3464. strategy[${w},8]=$p8
  3465. strategy[${w},9]=$p9
  3466. strategy[${w},T]=$pT
  3467. strategy[${w},A]=$pA
  3468. done < ${type}.txt
  3469. ## override the read strategy with the explicit play: y or n
  3470. strategy[${t}${hand},${upcard}]=${play}
  3471. ## save the new (temporary) strategy
  3472. rm -f ${type}.txt
  3473. for h in A T $(seq 9 -1 2); do
  3474. echo -n "${t}${h} " >> ${type}.txt
  3475. for u in $(seq 2 9) T A; do
  3476. echo -n "${strategy[${t}${h},${u}]} " >> ${type}.txt
  3477. done
  3478. echo >> ${type}.txt
  3479. done
  3480. if [ "${debug}" != "0" ]; then
  3481. cp ${type}.txt ${t}${hand}-${upcard}-${play}.str
  3482. fi
  3483. ## ensamble the full bs.txt
  3484. cat hard.txt soft.txt pair.txt > bs.txt
  3485. ## play!
  3486. blackjack
  3487. ## evaluate the results
  3488. ev[${t}${hand},${upcard},${play}]=$(grep mean ${t}${hand}-${upcard}-${play}.yaml | awk '{printf("%g", $2)}')
  3489. error[${t}${hand},${upcard},${play}]=$(grep error ${t}${hand}-${upcard}-${play}.yaml | awk '{printf("%g", $2)}')
  3490. done
  3491. ## choose the best one
  3492. ev_y=$(echo ${ev[${t}${hand},${upcard},y]} | awk '{printf("%+.2f", 100*$1)}')
  3493. ev_n=$(echo ${ev[${t}${hand},${upcard},n]} | awk '{printf("%+.2f", 100*$1)}')
  3494. if [ $n -le ${n_max} ]; then
  3495. ## if we still have room, take into account errors
  3496. error_y=$(echo ${error[${t}${hand},${upcard},y]} | awk '{printf("%.1f", 100*$1)}')
  3497. error_n=$(echo ${error[${t}${hand},${upcard},n]} | awk '{printf("%.1f", 100*$1)}')
  3498. else
  3499. ## instead of running infinite hands, above a threshold asume errors are zero
  3500. error_y=0
  3501. error_n=0
  3502. fi
  3503. echo -ne "\t${ev_y}\t(${error_y})"
  3504. echo -ne "\t${ev_n}\t(${error_n})"
  3505. if (( $(echo ${ev_y} ${error_y} ${ev_n} ${error_n} | awk '{print (($1-$2) > ($3+$4))}') )); then
  3506. best="y"
  3507. color=${GREEN}
  3508. best_string="yes"
  3509. elif (( $(echo ${ev_n} ${error_n} ${ev_y} ${error_y} | awk '{print (($1-$2) > ($3+$4))}') )); then
  3510. best="n"
  3511. color=${RED}
  3512. best_string="no"
  3513. else
  3514. best="x"
  3515. color=${NC}
  3516. best_string="uncertain"
  3517. n=$((${n} * 4))
  3518. fi
  3519. echo -e ${color}"\t"${best_string}${NC}
  3520. done
  3521. echo "| ${t}${hand}-${upcard} | $(printf %.1e ${n}) | ${ev_y} (${error_y}) | ${ev_n} (${error_n}) | ${best_string} | " >> table.md
  3522. echo " <!-- ${upcard} -->" >> ${type}.html
  3523. echo " <td>" >> ${type}.html
  3524. echo ${ev_y} ${error_y} | awk -f html_cell.awk >> ${type}.html
  3525. echo ${ev_n} ${error_n} | awk -f html_cell.awk >> ${type}.html
  3526. echo " </td>" >> ${type}.html
  3527. strategy[${t}${hand},${upcard}]=${best}
  3528. ## save the strategy again with the best strategy
  3529. rm -f ${type}.txt
  3530. for h in A T $(seq 9 -1 2); do
  3531. echo -n "${t}${h} " >> ${type}.txt
  3532. for u in $(seq 2 9) T A; do
  3533. echo -n "${strategy[${t}${h},${u}]} " >> ${type}.txt
  3534. done
  3535. echo >> ${type}.txt
  3536. done
  3537. done
  3538. done
  3539. cat header.txt hard.txt header.txt soft.txt header.txt pair.txt > bs.txt
  3540. rm -f hard.txt soft.txt pair.txt blackjack.conf
  3541. if [ "${debug}" == "0" ]; then
  3542. rm -f *.yaml
  3543. rm -f *.str
  3544. rm -f *.log
  3545. fi
  3546. @end verbatim
  3547. @bye