The game of Mastermind, produced by Invicta Plastics Ltd., is a deductive game for two players - the codemaker and the codebreaker. The codemaker chooses a secret code consisting of four pegs out of six possible colors. Repeated colors are allowed, so the set of possible codes is 1296. The codebreaker repeatedly guesses at the correct code and after each guess, receives input from the codemaker about how close the guess is to the secret code. The codemaker's input consists of black and white pegs; a black peg means that a peg in the codebreaker's guess is correct in both color and position; a white peg means that a peg in the guess is correct in color but not in position; and finally, no pegs means that there are peg(s) in the guess which are of the wrong color altogether. The purpose of the game is to solve the code (i.e. get four black pegs) in the smallest number of guesses.
Interest in the game has lead to the development of a JAVA applet that simulates the Mastermind. Algorithms that solve a 6 color/4 positions mastermind code have been developed. The algorithms brought to light a very surprising result - that the most simple strategy gives results within 97% of the optimum. This revelation has inspired the expansion of the mastermind problem to an m colors and n positions case.
This paper discuses research done on the performance of algorithms over a wide range of m's and n's. We sought to find out whether the basic algorithm that gave the excellent results in the 6 color 4 position case performed just as well in larger code set spaces (more colors and/or positions). Detailed descriptions of each algorithm are given, and algorithm optimization is discussed. We also display 3D graphs of the results achieved so far.