LOADS OF GAMES All rules

Rules · Strategy · History

How to play Codebreakers

One player hides a code of colored pegs. The other guesses, and each guess gets small pins as clues. Read them well and break the code before the rows run out.

Play Codebreakers free

The aim

Find a secret code of colored pegs in as few guesses as you can. Alone, the computer makes the code. In a duel, you take turns: each of you makes a code for the other to break.

The code

A code is a row of pegs, four to six of them. In some kinds a color can be used more than once. In some, a hole can be left empty, and empty then counts as a color.

The secret code in these examples: red, blue, yellow, green. The player guessing can’t see it.

Guessing

Each guess fills a whole row. It follows the same rules as the code. Then small pins tell you how you did:

  • Right color, right spot: a green pin.
  • Right color, wrong spot: a yellow pin.
  • No pin: that color isn’t in the code, or not that many times.

Get every peg right and the code is broken. Run out of rows first and it isn’t.

Playing on the site

  • Pick a color. Then tap a hole in the lit row. You can also drag a color onto a hole.
  • To take a peg out, tap it or drag it off.
  • When the row is full, press Check guess.
  • Making a code in a duel? Fill the secret row. Then press Lock in code.
  • Pick colors opens a panel with every color next to your row. It is handy on a phone.

Reading the pins

Each kind of game gives its pins one of two ways.

Clue per peg

The easier way. Each peg gets its own pin, right under it. You can see which pegs are right, which are in the wrong spot, and which aren’t in the code. Daily word games work like this too.

Clue per peg: green under red (right spot), yellow under yellow (wrong spot), nothing under the oranges.

Total only

The classic way, and harder. You learn how many green and yellow pins you got, but not which pegs they belong to. The pins sit together at the side of the row.

Total only: the same guess gets one green pin and one yellow pin. Which pegs they mean is for you to work out.

Repeated colors

Each peg in the code gives one pin at most. Green pins are counted first. Then, from left to right, a peg gets a yellow pin only if its color is still left over in the code.

Against red, red, blue, green, the guess red, green, red, red gets one green and two yellow. The code has only two reds, so only two of the four reds can score.

The kinds

Pick a kind under Change settings on the menu. Online, each kind has its own rating.

The boards are short on purpose. Each one has just enough rows for a strong player to break most codes, but not all. We tested this over thousands of codes. With a clue per peg, codes fall fast, so those boards are the shortest.

KindPegsColorsEmpty holesRepeatsPinsRows
Starter46NoNoClue per peg4
Classic46NoYesTotal only6
Peg by Peg58YesYesClue per peg6
Classic Expert58YesYesTotal only8
Mega610YesYesTotal only9
Numbers410 digitsNoNoTotal only7
Daily Code58YesYesClue per peg6
  • Starter is the place to begin: no repeats, and each peg gets its own pin.
  • Classic is the traditional game: four pegs, six colors, repeats, total only.
  • Peg by Peg has five pegs and eight colors, repeats and empty holes, and each peg gets its own green or yellow pin.
  • Classic Expert is Peg by Peg with total only.
  • Mega has six pegs, ten colors and empty holes. That makes nearly two million codes.
  • Numbers is the old pencil-and-paper game, often called Bulls and Cows. The code is four different digits. You’re told how many are “right” and how many are “close”.

Duels and scoring

Two players, online or against the computer. A duel is played in rounds. In each round, each player makes one code for the other.

  1. One player makes a secret code. Nobody else sees it, not even someone watching.
  2. The other guesses, row by row, until the code is broken or the rows run out.
  3. The code’s maker gets a point for every row used, and 1 more if the code was never broken.
  4. Then you swap.

After the last round, the most points wins. A tie is a draw. A duel is one round unless you pick more, up to three. When a code is done, everyone sees it.

Example: in Classic, you break your opponent’s code on your 4th guess, so they get 4. They use all 6 rows on yours and don’t break it, so you get 6 + 1 = 7. You win 7 to 4.

The Daily Code

One code a day, the same for everyone. It is a Peg by Peg code: five pegs, eight colors, empty holes and repeats. Each peg gets its own pin, and you have 6 rows. When you finish, you can share your result as green, yellow and white circles. They show how you did without giving the colors away.

Strategy

  • Only guess what could still be the code. Check each guess against every clue so far. Would it have got the same pins? If not, it can’t be the code. You would waste a row.
  • Open with two colors. In Classic, a first guess like two reds and two blues tells you more than four different colors.
  • Count colors first, spots second. Add up all the pins to learn how many of your colors are in the code. Then move pegs around to find where they go.
  • No pins is good news. A guess with no pins rules out every color in it.
  • When you make a code, use repeats and empty holes. Where the kind allows them, they are often the hardest codes to find.
  • Plan the last two rows. On the row before the last, pick a guess that rules out as many codes as you can. Then make your last guess one that fits every clue.

History

Code-breaking games are older than any box. Bulls and Cows, played with pencil and paper and a secret number of four different digits, may be a hundred years old or more. A “bull” is a right digit in the right place and a “cow” a right digit in the wrong one. Early computers played it too: in the late 1960s and early 1970s there were versions called Moo at Cambridge and at MIT.

In 1970 the game moved to a board with colored pegs, invented by Mordecai Meirowitz, and became a hit around the world. In 1976 Donald Knuth showed that the four-peg, six-color game can always be solved in five guesses. Later, pocket electronic code breakers and daily word games began to mark each letter or peg in place, as some kinds of Codebreakers do.

Codebreakers is our own take on the family: more pegs, more colors, empty holes, a daily code and duels.

Questions

Can the code use the same color twice?

In most kinds. Starter and Numbers never repeat; the others can.

Is an empty hole a color?

In the kinds with empty holes (Peg by Peg, Classic Expert, Mega and the Daily Code), yes. It can be in the code or in a guess, and it gets pins like any other color.

Why are the boards so short?

So that every code is a real puzzle. Each board has just enough rows that our strongest computer player breaks most codes in time, but not all of them.

Can my opponent see my code?

No. The code stays on the server until it is broken, the rows run out, or the duel ends. Then everyone sees it.

Can I play against a friend?

Yes, online with a code or a quick match. You can also duel the computer, or just break the computer’s codes on your own.

Can I take a peg back?

Yes, until you press Check guess. Tap the peg, or drag it off. Once a guess is checked, it counts, even against the computer.

Is there a hint button?

No. The pins are your clues. The Help button shows what they mean.

Is it free?

Yes. It plays in your browser on a computer, tablet or phone. Nothing to download.

Make a code, read the pins, and break it in as few rows as you can.

Play Codebreakers

More games to learn