gtheler 5 лет назад
Родитель
Сommit
afba392d2c
1 измененных файлов: 24 добавлений и 5 удалений
  1. +24
    -5
      README.md

+ 24
- 5
README.md Просмотреть файл

<asciinema-player src="doc/libreblackjack2.cast" cols="89" rows="28" preload="true" poster="npt:0:20"></asciinema-player> <asciinema-player src="doc/libreblackjack2.cast" cols="89" rows="28" preload="true" poster="npt:0:20"></asciinema-player>
``` ```


Edit the file [`blackjack.conf`](https://github.com/seamplex/libreblackjack/blob/master/blackjack.conf) in the same directory where the executable is run to set up rules, arranged shoes and other options. Type `help` at the prompt to get it.
Edit the file [`blackjack.conf`](https://github.com/seamplex/libreblackjack/blob/master/blackjack.conf) in the same directory where the executable is run to set up rules, arranged shoes and other options. See the `doc` directory for detailed documentation. Type `help` at the prompt to get it.


## Automatic playing ## Automatic playing


* [Perl](players/05-no-bust) * [Perl](players/05-no-bust)
* [Awk](players/08-mimic-the-dealer) * [Awk](players/08-mimic-the-dealer)
* [Bash](players/20-basic-strategy) * [Bash](players/20-basic-strategy)
* C
* Python
* [Python](players/30-ace-five)
## TCP Sockets ## TCP Sockets


To play through a TCP socket, call `blackjack` from `netcat`. On one host, do
To play through a TCP socket, call `blackjack` within `netcat`. On one host, do


``` ```
nc -l -p1234 -e blackjack
rm -f /tmp/f; mkfifo /tmp/f
cat /tmp/f | blackjack 2>&1 | nc -l 127.0.0.1 1234 > /tmp/f
``` ```


On the other one, connect to the first host on port 1234: On the other one, connect to the first host on port 1234:


Libre Blackjack is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Libre Blackjack is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.


# A note on the C++ implemenation

The first Libre Blackjack version (v0.1) was written in C. This version (v0.2) is a re-implementation of nearly the same functionality but written completely from scratch in C++. I am not a fan of C++ and still prefer old plain C for most of my programming projects, but for the particular case of Libre Blackjack these advantages of C++ over C ought to be noted:

* the inheritance mechanisms of C++ and virtual methods allows to have generic dealer and player classes from which particular games (dealers) and strategies (players) can be instantiated. This way, Blackjack variations like
- [Spanish 21](https://wizardofodds.com/games/spanish-21/)
- [Down under Blackjack](https://wizardofodds.com/games/down-under-blackjack/)
- [Free Bet Blackjack](https://wizardofodds.com/games/free-bet-blackjack/)
- [Blackjack Switch](https://wizardofodds.com/games/blackjack/switch/)
or even the Spanish “Siete y medio” could be also implemented in the same framework.

* the private members of the C++ classes allow information to be hidden between the dealer and the player, so a far better separation of information can be achieved. This also prevents “cheating” in players by looking at information which is not available for them (such as the dealer’s hole card or the content of the shoe).
* the virtual members of derived players and even be linked to other high-level programming languages parsers (such as Python or Julia) allowing to use the vast variety of AI/ML libraries available for these languages to implement advanced playing strategies.
* the usage of STL containers, methods and algorithms allows for a faster and cleaner implementation of cards, hands, decks and shoes.

# Further information # Further information


Home page: <https://www.seamplex.com/blackjack> Home page: <https://www.seamplex.com/blackjack>

Загрузка…
Отмена
Сохранить