The Codemaker signals if the Codebreaker has pegs of the right color and if they're in the right position.

Varying the number of colors and the number of holes results in a spectrum of Mastermind games of different levels of difficulty. Another common variation is to support different numbers of players taking on the roles of codemaker and codebreaker. The following are some examples of Mastermind games produced by Invicta, Parker Brothers, Pressman, Hasbro, and other game manufacturers:

The code breaker keeps guessing until he or she cracks the code or makes 12 incorrect guesses. The code maker earns a point every time the code maker takes a guess. If the code breaker is unable to decipher to code in 12 guesses the code maker receives an extra point. Once the agreed upon number of rounds have been completed, the person with the most points is the winner.

The two players decide in advance how many games they will play, which must be an even number. One player becomes the codemaker, the other the codebreaker. The codemaker chooses a pattern of four code pegs. Duplicates are allowed, so the player could even choose four code pegs of the same color. The chosen pattern is placed in the four holes covered by the shield, visible to the codemaker but not to the codebreaker.[3]

There are at least four open-source software implementations of the game concept:

Starting in 1973, the game box featured a photograph of a well-dressed, distinguished-looking man seated in the foreground, with a woman standing behind him. The two amateur models (Bill Woodward and Cecilia Fung) reunited in June 2003 to pose for another publicity photo.[8]

The codemaker gets one point for each guess a codebreaker makes. An extra point is earned by the codemaker if the codebreaker doesn't guess the pattern exactly in the last guess. (An alternative is to score based on the number of colored key pegs placed.) The winner is the one who has the most points after the agreed-upon number of games are played.

The Mastermind satisfiability problem is a decision problem that asks, "Given a set of guesses and the number of colored and white pegs scored for each guess, is there at least one secret pattern that generates those exact scores?" (If not, then the codemaker must have incorrectly scored at least one guess.) In December 2005, Jeff Stuckman and Guo-Qiang Zhang showed in an arXiv article that the Mastermind satisfiability problem is NP-complete.[15]

Game console with built-in storage tray and code peg shield

The original Mastermind game was released in the early 1970s, and several additional versions have been released over the decades.

Once feedback is provided, another guess is made; guesses and feedback continue to alternate until either the codebreaker guesses correctly, or twelve (or ten, or eight) incorrect guesses are made.

The game board features twelve rows, each of which contains four large holes beside four small holes. There is also another row with four large holes on one end of the board covered by a shield. This is where the person playing the role of the code maker sets up the hidden code that his or her opponent will try to crack. The code consists of four round headed code pegs in any of six different colors.

Mastermind or Master Mind is a code-breaking game for two players. The modern game with pegs was invented in 1970 by Mordecai Meirowitz, an Israeli postmaster and telecommunications expert.[1][2] It resembles an earlier pencil and paper game called Bulls and Cows that may date back a century or more.

The next time you feel like putting your critical thinking skills to the test, try your hand at the Mastermind board game. You'll have fun and polish your logic and reasoning techniques.

About Mastermind GamesShop the large inventory of games and Mastermind strategy board games!

Playing Mastermind board game is great entertainment for individuals who enjoy games that help hone their logic and deductive reasoning skills. This challenging game requires abstract reasoning and concentration. It is both educational and enjoyable.

The Codemaker creates a secret code with any four of the pegs (there are six colors).

Players are allowed 12 tries to crack the code, one for each row on the game board. The code breaker conveys his or her guesses by filling in a row of code pegs on the game board. The code breaker gives feedback by placing flat headed key pegs on the board to indicate which parts of the guess are right or wrong.

Subsequent mathematicians have been finding various algorithms that reduce the average number of turns needed to solve the pattern: in 1993, Kenji Koyama and Tony W. Lai found a method that required an average of 5625/1296 = 4.340 turns to solve, with a worst-case scenario of six turns.[10] The minimax value in the sense of game theory is 5600/1296 = 4.321.[11]

Computer and Internet versions of the game have also been made, sometimes with variations in the number and type of pieces involved and often under different names to avoid trademark infringement. Mastermind can also be played with paper and pencil. There is a numeral variety of the Mastermind in which a 4-digit number is guessed.[16]

Since 1971, the rights to Mastermind have been held by Invicta Plastics of Oadby, near Leicester, UK. (Invicta always named the game Master Mind.) They originally manufactured it themselves, though they have since licensed its manufacture to Hasbro worldwide, with the exception of Pressman Toys and Orda Industries who have the manufacturing rights to the United States and Israel, respectively.[7]

In November 2004, Michiel de Bondt proved that solving a Mastermind board is an NP-complete problem when played with n pegs per row and two colors, by showing how to represent any one-in-three 3SAT problem in it. He also showed the same for Consistent Mastermind (playing the game so that every guess is a candidate for the secret code that is consistent with the hints in the previous guesses).[14]

In 1977, Donald Knuth demonstrated that the codebreaker can solve the pattern in five moves or fewer, using an algorithm that progressively reduced the number of possible patterns.[9] The algorithm works as follows:

The Codebreaker places pegs in a pattern, trying to match the Codemaker's pattern to break the code.

With four pegs and six colors, there are 64 = 1296 different patterns (allowing duplicate colors).

Once the code maker has created the code, the other player has to attempt to guess the exact combination of code pegs, including both color and position. The player trying to crack the code has to use his or he logical reasoning skills to use the clues to narrow down which of the more than 1,200 possible combinations of pegs comprises the code. Following each guess, the code maker will provide clues about what the code really is.

The difficulty level of any of the above can be increased by treating “empty” as an additional color or decreased by requiring only that the code's colors be guessed, independent of position.