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
HoyleishCribbagePlayStrategyclass 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
Metadata
Release files for CribbageSim 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cribbagesim-1.0.2.tar.gz | 54.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cribbagesim-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 95.0 kB
Release files / cribbagesim-1.0.2.tar.gz
| Download URL | cribbagesim-1.0.2.tar.gz |
|---|---|
| Size | 54.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f131bf4e11ee2aec0a41eef2281f769b2d30b0c0942a628854fced5234dc09e
|
|
BLAKE2b-256 checksum How to use checksums |
486768dfbf48bcc3147fc631ec7491eb349eac299e329a88e99d2dfab2aeda2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2026.
Transparency logRelease files / cribbagesim-1.0.2-py3-none-any.whl
| Download URL | cribbagesim-1.0.2-py3-none-any.whl |
|---|---|
| Size | 40.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f9c0f477d98cd721db2b604f3e0c2a69f0b617c93a722050a193cbf1d5cfd82
|
|
BLAKE2b-256 checksum How to use checksums |
6a2fc0e54f1d0136c9b245322c7fb00b6ac0b9ad0c5add075a0cda9cf626e316
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2026.
Transparency log