This is a Python-based GUI implementation of the popular MasterMind game, developed using the Tkinter library. In this game, you need to guess the correct combination of colors within a set number of attempts, using hints to help you crack the code!
The goal is to guess the secret combination of colors generated by the computer. After each guess, you'll receive feedback in the form of color hints indicating how close your guess was.
- Choose Colors: You can select colors from a palette of 8 different colors.
- Place Guess: Click on the color buttons to submit your guesses in each row.
- Hints: After each guess, you'll receive feedback:
- Red: A color is correct and in the correct position.
- Gray: A color is correct but in the wrong position.
- Crack the Code: Continue guessing until you get all 4 colors in the correct positions. You only have 10 attempts!
- Win or Lose: If you guess the combination correctly within the attempts, you win! Otherwise, the game will reveal the correct code.
- Operating System: Ubuntu 20.04 or any system running Python 3.x
- Python Version: Python 3.8 or higher
You need the tkinter library to run the game. Install it by running the following command:
sudo apt-get install python3-tk-
Clone the repository and navigate to the project folder:
git clone <repository-url> cd <project-folder>
-
Install dependencies (if any) and then run the program:
python3 mastermind.py
-
Enjoy playing the MasterMind game!
- Generated Colors: The game will randomly generate a combination of 4 colors from a palette of 8.
- User Input: You will select 4 colors to form your guess.
- Hints:
- Red indicates that one of your colors is correct and in the right position.
- Gray indicates that one of your colors is correct but in the wrong position.
- No hint means the color is incorrect.
- Python Version: 3.8+
- OS: Ubuntu 20.04
For more details on how to play the MasterMind game, check out this MasterMind Game Rules.