MasterMind is a commercial version of an old game called ``bulls and cows'', in which two players, the codemaker and the codebreaker match their wits. The codemaker lays out a secret combination of colored pegs, which is hidden from the sight of the codebreaker. The codebreaker, drawing also pegs from a set, makes a guess at what the hidden combination looks like, and is answered by the codemaker with a black pin (which was traditionally called ``bull'') for each colored peg that is in the correct position and with the right color, and with a white pin (``cow'') for each peg with the correct color, but with a different position. This is shown in figure 1
The codebreaker is allowed to make a maximum number of guesses, after which the codemaker has won; if he can find the combination before that maximal number, he scores as many points as guesses. In a tournament, the winner is the one that has accumulated less guesses.
Actually, the old british game ``bulls and cows'' was somewhat different from MasterMind. It was played on paper, not on a board, all the secret digits must be different, and digits from 0 to 9 are allowed .