Mastermind is a game played by two players, the codemaker and the codebreaker.
The codebreaker will then try to guess the code. The second, the number of near matches, is the number of colors in the guess which are the right color, but in the wrong position. In the applet bellow the number of exact matches is indicated by small red dots, while white dots define the second number. In the real game the codemaker uses small pegs for the same purpose. Mastermind is a game of deduction.