How do you play the code breaker game?
A code of 4 colours is hidden, chosen from 6, and a colour can appear more than once. Build a guess by tapping colours from the palette, then press Check. Two numbers come back: how many pegs are the right colour in the right place, and how many more are the right colour but in the wrong place. Use the clues to narrow it down and crack the code within 10 guesses. Every colour also has a letter, so the game never depends on telling colours apart.
How is your Code Breaker result calculated?
Your result is how many guesses you needed, with your time. If 10 guesses run out, the code is shown and the game counts as not cracked.
How many guesses should it take?
There are 1,296 possible codes (6 colours in each of 4 places). In 1977 Donald Knuth showed that any of them can be found in at most five guesses, by choosing each guess to keep the worst case as small as possible. So five or fewer means playing as well as that computer strategy.
The game is the scoring of Mastermind, the board game invented by Mordecai Meirowitz in 1970, and it resembles an older pencil-and-paper game called bulls and cows.
How do you crack the code faster?
- Open with two pairs. A first guess of two colours, two pegs each, is the start of Knuth's strategy. It tells you about two colours at once without spreading the clues too thin.
- Make every guess possible. Before you check a guess, make sure it fits every clue so far. A guess that can't be the answer wastes a turn unless you are deliberately testing something.
- Change one thing to learn one thing. Swapping two pegs between guesses tells you which of them was in the right place.
For another puzzle of pure deduction, try the Shape Equation Puzzle; for numbers instead of colours, Make 24.
How do you read the clues?
Each guess gets two numbers: pegs of the right colour in the right place, then pegs of the right colour in the wrong place. Three deductions do most of the work:
- 0 and 0: none of the colours in that guess is in the code at all. Cross them all out.
- The two numbers add up to 4: you have every colour of the code, and only the order is left.
- Change one peg at a time: if the first number goes up, the new peg is right where it is; if the total drops, the peg you removed was in the code.
What can affect your Code Breaker result?
Luck on the first guess or two, and then method. A first guess with two colours, such as two of one and two of another, tells you about two colours at once without wasting a place. After that, every guess should be one that could still be the code: a guess the clues have already ruled out can teach you something, but it can't win. The game isn't timed, so there's no cost to stopping and checking each clue.