Skip to main content

A terminal-based code-breaking game Mastermind

Project description


Terminal-based python of classic board game Mastermind®

Mastermind board game

to get the game

Install with pip from the command line:

pip install open-mastermind

And run with this command:


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

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
cd open-mastermind
pip install -r requirements.txt

And to play from your downloaded code:


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


◍ : 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.

change the game parameters

Edit the file to:

  • more pieces to guess

  • more/fewer turns per game

  • new colors

  • different emoji playing pieces

screenshot of gameplay

screenshot of gameplay

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for open-mastermind, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size open_mastermind-0.1.2-py2-none-any.whl (5.3 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size open_mastermind-0.1.2-py3-none-any.whl (6.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size open_mastermind-0.1.2.tar.gz (4.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page