How to play Code breaker
- Pick a level. Classic is the original game: 4 pegs from 6 colors, colors can repeat, 10 tries. Easy has no repeated colors; Hard has 5 pegs and 8 colors.
- Click colors (or press their numbers) to fill the row, then press Check. Click a placed peg to take it back out.
- Read the clues next to your guess: each solid dot is a peg of the right color in the right place, each ring a right color in the wrong place. The dots don’t say which pegs they mean.
- Use the clues to narrow it down and crack the code before you run out of tries.
Strategy tips
In the classic game a first guess like 1 1 2 2 tells you about two colors at once and leaves fewer possibilities than four different colors. After that, the total of dots and rings tells you how many of your colors are in the code, whatever their order, so you can work out the colors before the places.
Only guess codes that could be right: check each guess against every clue so far, because a guess that contradicts a clue wastes a try. When you’re close, change one thing at a time (swap two pegs or replace one color) so you can see exactly what the change did to the dots.
About the game
Code breaking with colored pegs was popularized by the Mastermind board game in the early 1970s, which built on Bulls and Cows, a much older pencil-and-paper game with numbers. One player sets a secret code; the other has a limited number of guesses, with clues after each one, to work it out. It’s a good exercise in logical deduction, and a well-known example in computer science of solving a problem by narrowing down the possibilities.