Skip to main content

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

Project description

CribbageSim

Source code: GitHub

CribbageSim is a Python implementation of the Cribbage card game. It allows interactive play with one human player against one computer player. It also includes a simulation mode where both players are played by the computer. Simulation mode can be used to analyze different player strategies and to generate game-play statistics. In simulation mode, as deployed, the players use a play strategy based on that described by Hoyle's Rules of Games, supplemented with experience of the developer.

Credit where credit is due

  • The Strategy design pattern is used to implement both playing strategies and scoring card combinations, 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 HoyleishCribbagePlayStrategy class implements a player strategy that is similar to the one described in "Hoyle's Rules of Games," by A.H. Morehead and G. Mott-Smith, second revised edition, published by Signet, 1983. However, significant additions have been made based on the experience of the developer.

Requirements

Usage

To play the game interactively or to run various simulations:

python -m CribbageSim.main

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

Unittests

Unit tests for CribbageSim 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

cribbagesim-1.0.2.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

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

cribbagesim-1.0.2-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

Details for the file cribbagesim-1.0.2.tar.gz.

File metadata

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

File hashes

Hashes for cribbagesim-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9f131bf4e11ee2aec0a41eef2281f769b2d30b0c0942a628854fced5234dc09e
MD5 3dafe5a4a0dc27bdc60dc4b5b37cf92b
BLAKE2b-256 486768dfbf48bcc3147fc631ec7491eb349eac299e329a88e99d2dfab2aeda2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cribbagesim-1.0.2.tar.gz:

Publisher: release.yml on KevinRGeurts/CribbageSim

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

File details

Details for the file cribbagesim-1.0.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for cribbagesim-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f9c0f477d98cd721db2b604f3e0c2a69f0b617c93a722050a193cbf1d5cfd82
MD5 aa5bb0290a31bfeace773bb817c87ece
BLAKE2b-256 6a2fc0e54f1d0136c9b245322c7fb00b6ac0b9ad0c5add075a0cda9cf626e316

See more details on using hashes here.

Provenance

The following attestation bundles were made for cribbagesim-1.0.2-py3-none-any.whl:

Publisher: release.yml on KevinRGeurts/CribbageSim

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