Code breaker
Crack the hidden 4-peg code in 10 guesses. ● means right color, right spot; ○ means right color, wrong spot. Colors can repeat. A new code every day.
Daily code
How to crack the code
There are 6 × 6 × 6 × 6 = 1,296 possible codes. Every guess splits them into groups by the clue it would get, so a good guess is one where no group is very large. Some habits that help:
- Open with two pairs, like red red blue blue. It finds out quickly whether those colors are in the code at all.
- Only play codes that could still be right, unless you are deliberately testing new colors. The counter under the board shows how many are left.
- Read ● and ○ together. A total of 0 rules those colors out completely; a total of 4 means you have every color and only the order is wrong.
Common questions
How does code breaker work?
There is a hidden code of 4 pegs in 6 colors, and colors can repeat. After each guess you get two numbers: ● is how many pegs are the right color in the right spot, ○ is how many more are the right color but in the wrong spot. Use them to narrow it down in 10 guesses or fewer.
Is this the same as Mastermind?
It's the same classic code-breaking game. Mastermind is the board game version, invented by Mordecai Meirowitz in 1970; it in turn grew out of an older pencil-and-paper game called bulls and cows.
What is the best possible score?
Five guesses. Donald Knuth showed in 1977 that every code with 4 pegs and 6 colors can be cracked in at most five guesses, and that some codes can't be guaranteed in fewer.
What is a good first guess?
Two colors in pairs, like red red blue blue. Knuth's five-guess method starts that way, because it splits the 1,296 possible codes into the most useful groups.
Why does it say how many codes are still possible?
After each guess we count every code that fits all your clues so far. It is a quick way to see how much a guess taught you.
More games
- Daily nonogramA picture logic puzzle: fill the grid from the number clues.
- Prisoner's dilemmaTen rounds against a mystery strategy. Cooperate or betray?
- Rock paper scissorsPlay a bot that learns your habits as you go.
- Monty Hall problemPick a door, then stay or switch. Plus a million-game simulator.
- NimTake sticks, take the last one, beat a bot that knows the math.