Skip to main content

A terminal-based code-breaking game Mastermind

Project description

open-mastermind

Terminal-based python of classic board game Mastermind®

Mastermind board game

screenshot of gameplay

to get the game

Install with pip from the command line:

pip install open-mastermind

And run with this command:

mastermind

Although written in Python3.7, it's compatible back to Python2.7.

example game play

Each puzzle contains 4 boxes. Each turn you choose from 6 colors.

Can you guess the puzzle before your turns run out?

Color choices: r g y b m w

Example turn: rybg

Response:

◍ : correct color in correct position

○ : correct color in incorrect position

_ : incorrect color

The order of the response tiles is sorted and does not necessarily match the position of the colored tiles.

Type !h during gameplay to read these instructions.

Type !q during gameplay to quit and show the solution.

2-player mode

Solutions can be hashed and shared with other players. To generate a code for the solution red-green-yellow-blue (rgyb):

mastermind rgyb

> Your code to play rgyb is 20419

Then share the code 20419 with the other player, who plays the desired game like this:

mastermind 20419

It's serverless and also on the honor system. Codes are generated on the fly based on the 16-bit CRC value.

to get the code

Clone the repository, then install the requirements (currently only the non-standard python library colorama, which prints a colorful terminal.)

git clone https://github.com/philshem/open-mastermind.git
cd open-mastermind
pip install -r requirements.txt

And to play from your downloaded code:

python mastermind.py

change the game parameters

Edit the file params.py to:

  • more pieces to guess

  • more/fewer turns per game

  • new colors

  • different emoji playing pieces

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

open_mastermind-0.2.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distributions

open_mastermind-0.2.0-py3.7.egg (10.1 kB view details)

Uploaded Source

open_mastermind-0.2.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file open_mastermind-0.2.0.tar.gz.

File metadata

  • Download URL: open_mastermind-0.2.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for open_mastermind-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9887d9acf95c90058ac6ce2cebce4a5f670c506839967b2c992658bdb57cbaed
MD5 484dc1563ff4cd6eecd563e9a99566e1
BLAKE2b-256 87965342c7b2a80bda021a00775af3ee557f60de3eebd96ac1b15932e64f8a27

See more details on using hashes here.

File details

Details for the file open_mastermind-0.2.0-py3.7.egg.

File metadata

  • Download URL: open_mastermind-0.2.0-py3.7.egg
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for open_mastermind-0.2.0-py3.7.egg
Algorithm Hash digest
SHA256 35b2f4faee02948a6fe4757fe6e079e66e30b8f67b85ace092be65457ef1bb45
MD5 bebf68ca3ff392f5a13fc0ce698f27a8
BLAKE2b-256 0eec7b922ccb3fd512e8a7236437c4fd4fe09b66dbfc83cc09d985f3846e7f50

See more details on using hashes here.

File details

Details for the file open_mastermind-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: open_mastermind-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for open_mastermind-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3327792245778d201f38ad75348aaf0bef1ba37f487b1bc42853fe6c92762001
MD5 2b48918e5dd8ee7ba608b36c465b4454
BLAKE2b-256 0146cd02be2b05e4a44205d41628f3a4a277461aae2ae8156ababb35f694a3ac

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page