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
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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=true --no_insurance=true > /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. result: "(-15.8 ± 0.9) %"
  18. mean: -0.157675
  19. error: 0.00940803
  20. hands: 100000
  21. bankroll: -15767.5
  22. bustsPlayer: 0
  23. bustsDealer: 0.27344
  24. wins: 0.38585
  25. pushes: 0.04807
  26. losses: 0.56608
  27. ...
  28. ```
  29. > **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...
  30. -------
  31. :::{.text-center}
  32. [Previous](../00-internal) | [Index](../) | [Next](../05-no-bust)
  33. :::