Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 5 gadiem
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ---
  2. title: Always stand
  3. ...
  4. # Always stand
  5. > Difficulty: 02/100
  6. To play Blackjack as an “always-stander” run the following command:
  7. ```terminal
  8. yes stand | blackjack -n1e5 --flat_bet --no_insurance > /dev/null
  9. ```
  10. The UNIX command `yes stand` writes the string “stand” repeteadly to the standard output, which is piped to the executable `blackjack` (assumed to be installed system-wide). The arguments tell Libre Blackjack to play one hundred thousand hands (`-n1e5`) using a flat bet (`flat_bet`, it defaults to a unit bet in each hand) and without asking for insurance if the dealer shows an ace (`no_insurance`). As there is no `blackjack.conf` file, the rules are---as expected---the default ones (see the documentation for details).
  11. The `/dev/null` part is important, otherwise Libre Blackjack will think that there is a human at the other side of the table and will
  12. 1. run slower (it will add explicit time delays to mimic an actual human dealer), and
  13. 2. give all the details of the dealt hands in the terminal as ASCII (actually UTF-8) art
  14. This example is only one-way (i.e. the player ignores what the dealer says) so it is better to redirect the standard output to `/dev/null` to save execution time. The results are written as a [YAML](http://yaml.org/)-formatted data to `stderr` by default once the hands are over, so they will show up in the terminal nevertheless. This format is human-friendly (far more than JSON) so it can be easily parsed, but it also allows complex objects to be represented (arrays, lists, etc.).
  15. ```yaml
  16. ---
  17. rules:
  18. decks: 6
  19. hands: 100000
  20. hit_soft_17: 1
  21. double_after_split: 1
  22. blackjack_pays: 1.5
  23. rng_seed: -2067081387
  24. number_of_burnt_cards: 0
  25. no_negative_bankroll: 0
  26. max_bet: 0
  27. penetration: 0.75
  28. penetration_sigma: 0.05
  29. cpu:
  30. user: 0.238384
  31. system: 0.226465
  32. wall: 0.462519
  33. second_per_hand: 4.6e-06
  34. hands_per_second: 2.2e+05
  35. player:
  36. wins: 0.38547
  37. pushes: 0.04744
  38. losses: 0.56709
  39. dealer_blackjacks: 0.04749
  40. player_blackjacks: 0.04803
  41. dealer_busts: 0.27168
  42. player_busts: 0
  43. doubled_hands: 0
  44. doubled_wins: 0
  45. insured_hands: 0
  46. insured_wins: 0
  47. number_of_hands: 100000
  48. number_of_shuffles: 2070
  49. total_money_waged: 100000
  50. worst_bankroll: -15870.5
  51. final_bankroll: -15868
  52. return: -0.15868
  53. variance: 0.984727
  54. deviation: 0.992334
  55. error: 0.00313804
  56. result: "(-15.9 ± 0.6) %"
  57. ...
  58. ```
  59. > **Exercise:** verify that the analytical probability of getting a natural playing with a single deck (for both the dealer and the player) is 32/663 = 0.04826546...
  60. -------
  61. :::{.text-center}
  62. [Previous](../00-internal) | [Index](../) | [Next](../05-no-bust)
  63. :::