https://github.com/bilbottom/blackjack
Blackjack, also called 21.
https://github.com/bilbottom/blackjack
game python
Last synced: over 1 year ago
JSON representation
Blackjack, also called 21.
- Host: GitHub
- URL: https://github.com/bilbottom/blackjack
- Owner: Bilbottom
- Created: 2021-12-20T19:42:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-08T21:06:38.000Z (over 1 year ago)
- Last Synced: 2025-01-08T22:13:41.586Z (over 1 year ago)
- Topics: game, python
- Language: Python
- Homepage:
- Size: 161 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://www.python.org/downloads/release/python-3110/)
[](https://python-poetry.org/)
[](https://github.com/Bilbottom/blackjack/actions/workflows/tests.yaml)
[](https://github.com/dbrgn/coverage-badge)

[](https://github.com/prettier/prettier)
[](https://github.com/astral-sh/ruff)
[](https://results.pre-commit.ci/latest/github/Bilbottom/blackjack/main)
---
# Blackjack ♠️♥️♣️♦️
Blackjack, also called 21.
## Sample Game 📝
Set up a game with some number of players and some number of decks:
```python
import blackjack
game = blackjack.Game(min_bet=10)
game.standard_setup(number_of_players=1, number_of_decks=6)
game.play_game()
```
A typical game will look something like this:
```
Dealer
[T♣ ??] [{10}]
Player_1 has £500 with hand:
[3♥ 8♣] {11} stake: £10
Player_1's turn:
Playing hand [3♥ 8♣] {11}
[h] Hit, [s] Stand, [d] Double down, [sp] Split?
Player chose DOUBLE_DOWN
Dealer [T♣ 3♣ 4♦] {17}
Player_1 [3♥ 8♣ Q♦] {21}
Outcome: win
Play another round? [Y/n]
--------------------
Game ended with:
- Player_1: £510
```
## Contributing 🤝
This is just a personal project (so this instruction is just for me).
The Python packaging is managed with [Poetry](https://python-poetry.org/); check which version is in the [poetry.lock](poetry.lock) file.
```bash
poetry install --with dev,test
pre-commit install --install-hooks
```