Skip to main content

Cribbage for your command line

Project description

# Cribbage for your command line

Implementation of [cribbage](https://www.pagat.com/adders/crib6.html) 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.

  • Brute Force. This opponent uses an enumerative strategy to determine the move with the greatest possible reward (points), and takes that move.

  • Trained. This opponent plays according to predictions made by a machine learning model. The predictions are based the outcomes of the games in the training data set (see the train directory).

## Installation

Install using pip:

`bash pip install cribbage `

Or install from the source

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

## How to use

If you want to play an easy game against the computer, you can run with the following.

`bash cribbage human random --name1 Alex --name2 Amy `

If you would like to try playing one of the AI opponents (you likely will not win), you can run with the following.

`bash cribbage human brute_force --name1 Alex --name2 Amy `

In either case, replace “Alex” with your name and “Amy” for the name you wish to call the opponent, or omit them if you don’t care about naming the players.

## Help

Run cribbage -h for more.

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.0.1.tar.gz (9.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: cribbage-1.0.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cribbage-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9bbb7ff6b1328d013908c87bae486a0ad9fdf34f5895ad59b1a3517774e6232f
MD5 ec2e05c2ff99be68153edc03cca81d2f
BLAKE2b-256 2ec17f8cf1e978ca5e4344f05a9a8c2c89cb53535dd335341f28fb471d76a5fd

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