Skip to main content

BlackjackSim is a Blackjack card game simulator that can be played interactively or automatically to generate game-play statistics.

Project description

BlackjackSim

Source code: GitHub

BlackjackSim is a Python implementation of the Blackjack card game. It allows interactive play with one player and a computer dealer. It also includes a simulation mode where both the dealer and the player are played by the computer. Simulation mode can be used to analyze different player strategies over many hands, and to generate game-play statistics. In simulation mode, the player uses a play strategy described by Hoyle's Rules of Games.

Credit where credit is due

  • The Strategy design pattern is used to implement playing strategies, and follows the concepts, UML diagrams, and examples provided in "Design Patterns: Elements of Reusable Object-Oriented Software," by Eric Gamma, Richard Helm, Ralph Johnson, and John Vlissides, published by Addison-Wesley, 1995.
  • The HoylePlayerPlayStrategy class implements the player strategy as described in "Hoyle's Rules of Games," by A.H. Morehead and G. Mott-Smith, second revised edition, published by Signet, 1983.

Requirements

Usage

To play the game interactively or to run various simulations:

python -m BlackjackSim.main

A menu of options for play and simulation will be presented.

Unittests

Unit tests for BlackJackSim have filenames starting with test_. To run the unit tests, type python -m unittest discover -s .\..\tests -v in a terminal window in the project directory.

License

MIT License. See the LICENSE file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blackjacksim-1.0.0.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blackjacksim-1.0.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file blackjacksim-1.0.0.tar.gz.

File metadata

  • Download URL: blackjacksim-1.0.0.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for blackjacksim-1.0.0.tar.gz
Algorithm Hash digest
SHA256 63926cccaf0b15a5d4f773779056570a76d494eb5953b7417b658b2c3a47ce80
MD5 f223e322b03ba286a5cf8befc7868ce7
BLAKE2b-256 6f20fb27c88bb710ae998cca825fa2282ff8dad1c3b5dd46803a0a6be6fb7ee6

See more details on using hashes here.

Provenance

The following attestation bundles were made for blackjacksim-1.0.0.tar.gz:

Publisher: release.yml on KevinRGeurts/BlackjackSim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file blackjacksim-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: blackjacksim-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for blackjacksim-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 485dec33bb8a39da6eeccdb26ee5286388168853689691b815de49f8ce9c5573
MD5 ad92c278da122b4deefdfe9b5b4aa706
BLAKE2b-256 01d0438c4452a9d6790ced6b20841cc6f9b63929599b6e9d39ef53a4c5ed82b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for blackjacksim-1.0.0-py3-none-any.whl:

Publisher: release.yml on KevinRGeurts/BlackjackSim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page