Mastermind
Mastermind is a code-breaking game. One player (the machine in this case) creates a code and the other tries to break the code.
The code is a sequence of 4 digits. Each digit is a number from 0 to 9 and can't appear more than once.
After each guess, the machine gives feedback to the player, consisting of two numbers:
- Number of digits that are in the correct position
- Number of digits that are in the code but not in the correct position
For example, if the code is 1234 and the guess is 1356, the feedback is 1-1. The digit 1 is in the correct position and the digit 3 is in the code but not in the correct position.
The player has 10 attempts to break the code. If the player can't break the code in 10 attempts, the machine wins.