Skip to main content

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

Release files for open-mastermind 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for open-mastermind 0.2.0
File Size Uploaded
open_mastermind-0.2.0.tar.gz 5.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for open-mastermind 0.2.0
File Interpreter ABI Platform
open_mastermind-0.2.0-py3.7.egg Legacy Egg format - - Details
open_mastermind-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.2 kB

Release files / open_mastermind-0.2.0.tar.gz

Download URL open_mastermind-0.2.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9887d9acf95c90058ac6ce2cebce4a5f670c506839967b2c992658bdb57cbaed
BLAKE2b-256 checksum
How to use checksums
87965342c7b2a80bda021a00775af3ee557f60de3eebd96ac1b15932e64f8a27
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / open_mastermind-0.2.0-py3.7.egg

Download URL open_mastermind-0.2.0-py3.7.egg
Size 10.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
35b2f4faee02948a6fe4757fe6e079e66e30b8f67b85ace092be65457ef1bb45
BLAKE2b-256 checksum
How to use checksums
0eec7b922ccb3fd512e8a7236437c4fd4fe09b66dbfc83cc09d985f3846e7f50
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / open_mastermind-0.2.0-py3-none-any.whl

Download URL open_mastermind-0.2.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3327792245778d201f38ad75348aaf0bef1ba37f487b1bc42853fe6c92762001
BLAKE2b-256 checksum
How to use checksums
0146cd02be2b05e4a44205d41628f3a4a277461aae2ae8156ababb35f694a3ac
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.2.0 This release

3 release files

0.1.4

3 release files

0.1.3

3 release files

0.1.2

3 release files

0.1.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page