Mastermind is a boardgame with 2 players, the code maker and the code breaker you are the code breaker. The code maker creates a code using 4 colored pegs in any order they wish. The code breaker attempts to guess the code in 12 turns. With each turn, the code breaker is given two pieces of information: 1) The number of exact matches 2) The number of color matches.
- Colors can be repeated, a code does not have to contain all colors.
- Valid Colors:
Red
,Green
,Blue
,Yellow
- Valid Codes
[Red, Red, Red, Red]
,[Blue, Green, Yellow, Green]
Create a code and create a function that will take guess and see if it matches the code you created. Remember the code breaker only gets 12 guesses, but they can use the informantion from the previous guess to refine their current guess.