Code Breaker Online Free
Crack the hidden code of coloured pegs. After each guess you’re told how many pegs are in the right place and how many are the right colour in the wrong place.
How Code Breaker works
Code Breaker is a deduction game in the style of the classic board game Mastermind. The computer hides a code of four coloured pegs. You guess, and for each guess you get one filled marker for every peg that is the right colour in the right place, and one white marker for every peg that is a right colour in the wrong place. The markers don’t say which pegs they mean, so you have to work that out.
With six colours there are 1,296 possible Classic codes, yet any of them can be cracked in five guesses or fewer with the right strategy, a result proved by the computer scientist Donald Knuth in 1977. Easy codes never repeat a colour, and Hard codes have five pegs and eight colours. For another puzzle solved by deduction, try Futoshiki or the 24 Game.
How to play Code Breaker
- The computer picks a secret code: four pegs (five on Hard), each one of six colours (eight on Hard). Colours can repeat, except on Easy.
- Tap colours to fill the pegs of your guess. Tap a peg to choose which one to change, and use ⌫ to clear it. On a keyboard, type the colour numbers and press Enter.
- Press Check. A filled marker means one peg is the right colour in the right place; a white marker means one peg is a right colour but in the wrong place. The order of the markers tells you nothing.
- Use the clues to make your next guess. Crack the code within 10 guesses (12 on Hard) to win.
- Hint fills your row with a code that fits every clue so far, and tells you how many codes are still possible. Show code gives up and reveals the answer.
Code Breaker skills
- Deductive reasoning
- Using clues to rule out possibilities
- Planning guesses that give the most information
Level: Ages 7 and up
Tips for Code Breaker
Start with two pairs, such as 1 1 2 2. It tests two colours at once and gives clearer clues than four different colours.
If a guess scores nothing at all, every colour in it is out of the code. That’s a very useful result.
Every new guess should fit all the clues you have so far. If it couldn’t possibly be the answer, you’re wasting a turn.
Change one or two pegs at a time from a guess you understand, and watch how the markers change. That tells you exactly which pegs matter.
Code Breaker questions and answers
How do you play Code Breaker?
Guess the hidden code of coloured pegs. After each guess, a filled marker shows a peg that is the right colour in the right place and a white marker shows a right colour in the wrong place. Use the clues to crack the code within 10 guesses.
Is this the same as Mastermind?
It uses the same rules as the classic code-breaking game. Mastermind® is a trademark of Invicta Plastics, which published the board game in 1971; this is an independent online version of the same kind of puzzle.
What is the best first guess?
For the Classic game with four pegs and six colours, two pairs such as 1 1 2 2 is the best-known opening. Donald Knuth showed that starting this way lets you always win in five guesses or fewer.
How many possible codes are there?
Easy has 360 codes (no colour repeats), Classic has 6 × 6 × 6 × 6 = 1,296, and Hard has 8 to the power of 5, which is 32,768.
Is Code Breaker good for kids?
Yes. It needs no arithmetic, just careful reasoning about clues, so children from about 7 can play. Start on Easy, where colours don’t repeat.