- A hit means that the number is in the correct position.
- A miss means that the number is present but in a different position.
The goal of the game is for player 2 to guess the number which player 1 thought of.
Throwing in the computer
Now, we bring the computer into the picture. The computer should ask the player to guess a 4-digit number. The computer should guess the number using the information of hits and misses. The question is how can we program the computer to guess the correct number using only the information provided by way of the hits and misses counts.