How to play Code Breaker
Work out a hidden code of coloured pegs from black pins (right place) and white pins (right colour, wrong place). Also known as Bulls and cows.
The rules
- A code of 3, 4 or 5 coloured pegs is hidden. On some levels colours can repeat.
- Make a guess with the same number of pegs.
- You get one black pin for each peg of the right colour in the right place.
- You get one white pin for each other peg that is a right colour in the wrong place. The pins don’t say which pegs they mean.
Playing Code Breaker on Puzzle Solvers
- Choose a level — from 3 pegs and 4 colours up to 5 pegs and 8 colours with repeats — and press New Puzzle.
- Tap colours on the palette (or keys 1–8) to fill your guess. Tap a peg position to change it, ⌫ to step back.
- Press Check. A black pin means a peg of the right colour in the right place; a white pin means a right colour in the wrong place.
- Use the pins to narrow it down. Hint tells you how many codes still fit and suggests a guess that splits them well.
A worked example
The code has 4 pegs from 6 colours with no repeats. You guess red, blue, green, yellow and get 1 black, 2 white: three of those colours are in the code, one in its right place.
Next you guess red, green, purple, blue. If that gets 0 black, 3 white, red isn’t first and green isn’t second — and purple is in the code.
Strategies
- Test many colours early. With no repeats, a first guess of all different colours tells you which colours are in the code.
- Zero pins is great news. A guess with no pins rules out every colour in it at once.
- Keep every clue. Your next guess should fit every pin you have had so far — otherwise you may learn nothing new.
- Swap to find places. Once you know the colours, move them around: a white pin turning black shows where one belongs.
Common mistakes
- Ignoring earlier pins and guessing something that can’t be the answer.
- Thinking a black pin belongs to a particular peg — it could be any of them.
Where it comes from
Code-guessing games with right-place and right-colour feedback go back to the pencil-and-paper game Bulls and Cows, played for well over a century. This version was made for this site.
Frequently asked questions
Can colours repeat?
On the Hard and Expert levels, yes. On Easy and Medium every colour in the code is different.
Is there a guess limit?
The board shows 8 to 12 rows depending on the level — try to finish within them.
What does the hint do?
It counts the codes that still fit all your pins, points out anything certain, and suggests a guess that leaves as few codes as possible whatever the pins say.
Keep going
- Play Code Breakera fresh puzzle every time
- Number MemoryStudy numbers in coloured shapes for a short time, then answer surprise…
- Letter SumsReplace each letter with a digit — different letters, different digits, no…
- Logic GridUse clues and a grid of ticks and crosses to work out which person has which…
All guides: How to play every puzzle and game.