Skip to main content

A Python package that simulates the Mastermind game with a powerful solver, with support for game for up to 9 colors and 9 pegs.

Project description

Mastermind Logo

Version: GitHub tag GitHub Release Python Version PyPI - Version
Meta: GitHub License PyPI Status Repo Size pre-commit.ci status

Links:

Mastermind

A terminal Mastermind game with 4 modes and a built-in magic solver. Install with pip and play in seconds — no configuration needed.

What is Mastermind?

Mastermind is a classic code-breaking game: one player hides a secret code, the other tries to crack it. After each guess, you get feedback on how close you are — and you have to use that to narrow it down before you run out of attempts. Simple to learn, surprisingly deep to master.

Features

  • Play — Guess the secret code yourself
  • Watch — Let the AI solve it optimally
  • Assist — Get AI suggestions while playing a real game
  • Rules — Learn how to play

Getting Started

Prerequisites

Just install Python 3.12+ and pip — the Java runtime is bundled for Linux, Windows, and macOS.

For Android, install Termux and run pkg install openjdk-21 first.

Technical Details for Developers
  • JPype: bridges Python and Java at runtime, allowing the Python UI to call into the high-performance Java solver directly without a subprocess.

Installation

  1. Install Python 3.12+ if you haven't already.

  2. Install the latest release:

    pip install mastermind-ai
    
  3. Run the program:

    mastermind
    

[!TIP] If the above does not work, see the Troubleshooting Guide.

You can also try it in your browser with Google Colab.

Contributing

Contributions are welcome! See the Contributing Guidelines.

License

Licensed under MIT License by @FlysonBot.

Questions?

Feel free to leave questions in the Discussions or open an Issue.

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

mastermind_ai-2.0.1b0.tar.gz (42.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mastermind_ai-2.0.1b0-py3-none-any.whl (42.3 MB view details)

Uploaded Python 3

File details

Details for the file mastermind_ai-2.0.1b0.tar.gz.

File metadata

  • Download URL: mastermind_ai-2.0.1b0.tar.gz
  • Upload date:
  • Size: 42.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mastermind_ai-2.0.1b0.tar.gz
Algorithm Hash digest
SHA256 d1912c4e4dae0605c3d26a956cb0a8d532e1e4b858010a0471d3c9c3aedbd634
MD5 02ad543781b33e0a88c4f3559948745d
BLAKE2b-256 d61da6f4d35e57753b4f6e543bb37842b85098778c8fe56a7378fa25b99ede56

See more details on using hashes here.

File details

Details for the file mastermind_ai-2.0.1b0-py3-none-any.whl.

File metadata

  • Download URL: mastermind_ai-2.0.1b0-py3-none-any.whl
  • Upload date:
  • Size: 42.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mastermind_ai-2.0.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 55a8da5034543b375dcde93328d8dabcefcf8f8ea8d71d35a1b7cec7cec21329
MD5 873ae2ba600d77bd21728d916d7a9dfb
BLAKE2b-256 0a96c3bf0310797522f5b5678f36227ff0abd5b6dfa0c380880afd26e27b23a2

See more details on using hashes here.

Supported by

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