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.1.tar.gz (52.8 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.1-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cribbagesim-1.0.1.tar.gz
  • Upload date:
  • Size: 52.8 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.1.tar.gz
Algorithm Hash digest
SHA256 91baf493aa2a335457684521f2ea1b9db1a789c918a554401db915460374cc5b
MD5 fe1d41a0f2a88b52d9fd5dbb27a58b26
BLAKE2b-256 0a3f35f3ba105df5ab3666416ff4f145f23a9fd361c848031942d62da64315b8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cribbagesim-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 39.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fce754f5d599f354506bec40cc157be56fd8d7e2cceeae71c0b7ed118a0ca7c4
MD5 b3c32254ebd674728d652500507ca6ad
BLAKE2b-256 71834e71f8033237fd0a15a09d72fa7ac658706b2729b517a8f807ce9ab9da07

See more details on using hashes here.

Provenance

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