How to play Code Breaker
rules · strategies · worked example

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.

▶ Play Code Breaker

The rules

  1. A code of 3, 4 or 5 coloured pegs is hidden. On some levels colours can repeat.
  2. Make a guess with the same number of pegs.
  3. You get one black pin for each peg of the right colour in the right place.
  4. 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

  1. Choose a level — from 3 pegs and 4 colours up to 5 pegs and 8 colours with repeats — and press New Puzzle.
  2. Tap colours on the palette (or keys 1–8) to fill your guess. Tap a peg position to change it, ⌫ to step back.
  3. 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.
  4. Use the pins to narrow it down. Hint tells you how many codes still fit and suggests a guess that splits them well.

Open the Code Breaker game →

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

Common mistakes

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

All guides: How to play every puzzle and game.