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.0.tar.gz (52.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.0-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cribbagesim-1.0.0.tar.gz
  • Upload date:
  • Size: 52.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.0.tar.gz
Algorithm Hash digest
SHA256 5562e9de8b2483b4e8a84425bec0a7a739193dfe4bb3326a5eaa04787ede48ac
MD5 7e6caeefe84d871f084ae32e3f8ecb65
BLAKE2b-256 6b83e05b6efa175847dd7f5b694c9a639a7ec59741328788e3ff6a52094a78c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for cribbagesim-1.0.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: cribbagesim-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 39.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89ae8eb97e512caea8adcb385065ce596899c13d9a11f4822e0158b69112c014
MD5 0502c821f9ca3ec6c512a876876a4742
BLAKE2b-256 953441090e9bf643eb001600cb8428bfc5bbefb617f17f62546793e5eee77569

See more details on using hashes here.

Provenance

The following attestation bundles were made for cribbagesim-1.0.0-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