Skip to main content

Cribbage for your command line

Project description

Implementation of cribbage for two players. Text-based GUI for use on your command line (so you can appear to be working). Several kinds of opponents.

Opponents

  • Random. This opponent plays a random legal move

  • Expert. This opponent uses an enumerative strategy to determine the move with the greatest possible reward (points), and takes that move. The author wrote the optimal policy

  • Student. This opponent is a deep neural network that has been trained via self-play using Google Keras and OpenAI Gym (see /train for details) to execute an optimal policy

Installation

Install using pip

pip install cribbage

Or install from the source

git clone git@github.com:dacarlin/cribbage.git
cd cribbage
python setup.py install

How to use

From the command line, specify the kinds of players you want in the game

cribbage human random

You can also name the players

cribbage human random --name1 Osha --name2 Otto

If you would like to try playing one of the AI opponents, you can run with the following

cribbage human expert --name1 Alne --name2 Arin

Both the Student and the Expert players achieve performance that is better than most humans.

Help

Run cribbage -h for an explanation of the command line arguments

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

cribbage-1.2.1.tar.gz (10.1 kB view details)

Uploaded Source

File details

Details for the file cribbage-1.2.1.tar.gz.

File metadata

  • Download URL: cribbage-1.2.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.4

File hashes

Hashes for cribbage-1.2.1.tar.gz
Algorithm Hash digest
SHA256 409d7a4fe901e2c242db3c55167b2238f6bf7f2c092a0b9556360db0c9dd054b
MD5 322d4516aee84c9d90577cc478e770dd
BLAKE2b-256 b88b5b3d8bbdcd8d84ab95c12186cf0d4f8fa0590cfb07ed8c5e495db1e3e104

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page