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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5562e9de8b2483b4e8a84425bec0a7a739193dfe4bb3326a5eaa04787ede48ac
|
|
| MD5 |
7e6caeefe84d871f084ae32e3f8ecb65
|
|
| BLAKE2b-256 |
6b83e05b6efa175847dd7f5b694c9a639a7ec59741328788e3ff6a52094a78c4
|
Provenance
The following attestation bundles were made for cribbagesim-1.0.0.tar.gz:
Publisher:
release.yml on KevinRGeurts/CribbageSim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cribbagesim-1.0.0.tar.gz -
Subject digest:
5562e9de8b2483b4e8a84425bec0a7a739193dfe4bb3326a5eaa04787ede48ac - Sigstore transparency entry: 768996308
- Sigstore integration time:
-
Permalink:
KevinRGeurts/CribbageSim@a01f36ae492f5d888aa019f9f4932971e2452d6e -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/KevinRGeurts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a01f36ae492f5d888aa019f9f4932971e2452d6e -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ae8eb97e512caea8adcb385065ce596899c13d9a11f4822e0158b69112c014
|
|
| MD5 |
0502c821f9ca3ec6c512a876876a4742
|
|
| BLAKE2b-256 |
953441090e9bf643eb001600cb8428bfc5bbefb617f17f62546793e5eee77569
|
Provenance
The following attestation bundles were made for cribbagesim-1.0.0-py3-none-any.whl:
Publisher:
release.yml on KevinRGeurts/CribbageSim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cribbagesim-1.0.0-py3-none-any.whl -
Subject digest:
89ae8eb97e512caea8adcb385065ce596899c13d9a11f4822e0158b69112c014 - Sigstore transparency entry: 768996314
- Sigstore integration time:
-
Permalink:
KevinRGeurts/CribbageSim@a01f36ae492f5d888aa019f9f4932971e2452d6e -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/KevinRGeurts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a01f36ae492f5d888aa019f9f4932971e2452d6e -
Trigger Event:
workflow_dispatch
-
Statement type: