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 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.