A Python version of the Mastermind guessing game.
Go to file
Pilot 30f54f438f Updates some control flow issues.
- Updates `calc` to return if the user won.
     - We can then look at the status (win) and continue the loop
     instead of falling through to the "Try again?..." section.
 - Adds continuation after a caught error to prevent the secret from
 resetting
 - Empties the `secret` before regenerating it.
     - `generateSecret() appends to the secret so the second game had a
     len(secret) of 8
     - This caused the compare function to out of bounds on the `guess`
     array.
 - Changed the output formatting of the hit to help readability.

 - Some ideas
     - setting a variable to a length of 4 and referencing that in
     generateSecret, checkGuess, and compare would allow changing the
     difficulty, example:
        - Easy: length 5
        - Medium: length 6
        - Hard: length 8
     - Ask the user for a difficulty before the start of the game.
2020-09-15 11:14:50 -04:00
LICENSE Initial commit 2020-09-14 00:47:17 +00:00
README.md Updated README 2020-09-13 19:08:36 -06:00
main.py Updates some control flow issues. 2020-09-15 11:14:50 -04:00

README.md

pystermind

A Python version of the Mastermind guessing game.

How it works

User starts it in Python (with source) or with the built executable.

How to play

Guess the correct sequence of 4 colors.

This version has 4 colors to choose from. You'll likely be able to change it yourself and configure how hard or easy the game is.

That's for another commit.

Remember...

Don't forget to be wholesome. This world is hard enough as it is.

Contact me:

wholesomedonut at tuta dot io