https://github.com/acevedojetter/master-mind
Master Mind Game in python to run in the terminal
https://github.com/acevedojetter/master-mind
five-guess-algorithm mastermind
Last synced: 10 months ago
JSON representation
Master Mind Game in python to run in the terminal
- Host: GitHub
- URL: https://github.com/acevedojetter/master-mind
- Owner: AcevedoJetter
- Created: 2023-07-10T20:48:01.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-13T04:14:19.000Z (almost 2 years ago)
- Last Synced: 2025-04-28T14:50:15.892Z (about 1 year ago)
- Topics: five-guess-algorithm, mastermind
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Master Mind Game and Solver
Rules for the game can be found [here](). The code in `main.py` is for 6 colors and 4 pegs but can be changed to use other amount of colors.
# How to play
To begin, run the file in the terminal: `python3 main.py`. Once the game begins, you should take the first guess.
To guess, write the first letter of the color you would like to guess. In the current game, there are six colors: red (r), blue (b), yellow (y), green (g), orange (o), and purple (p). A guess consist of four colors, which could be repeated, separated by a space. Examples: `r b g y`, `r r b o`, `p p p p`, etc.
After the first guess, you will get a message with the amount of black key pegs and white key pegs in no specific order. A black key peg means that you got a color in the correct position and a white key peg means that you have a correct color but in the wrong position. This will be given as four strings `b`, `w`, and `_` for black key peg, white key peg, and not a black key peg nor a white key peg, respectively.
This will continue until you get the correct combination, or you have used all your guesses.
# Using the Five-guess algorithm
The [Five-guess algorithm]() will be implemented soon.