Code Breaker

The rules of Code Breaker

In brief

The app picks a secret code of colored pegs. You make one guess per row. After each guess, the app tells you how many pegs are correctly placed (right color, right position) and how many are misplaced (right color, different position), without saying which ones. You win if a row has all its pegs correctly placed; you lose if all rows are used up.

The goal

Find the color and position of each peg in the secret code, using as few rows as possible. The number of pegs, colors and rows depends on the level you choose:

LevelPegsColorsRowsAt most one color
Easy3510once
Intermediate468once
Hard57152 times
Extreme67203 times

Setup

The app picks the code at random at the start of the game. A level with 6 colors uses the first 6 colors of the palette, in this order:

  • red
  • yellow
  • blue
  • orange
  • purple
  • green

At the Easy level, it's the first 5; at the Hard and Extreme levels, the first 7. On this site, each peg shows the first two letters of its color as a marker. The code never has an empty slot.

Making a guess

On the current row, in the app:

  • tap a slot in the current row, then a color from the palette;
  • double-tap a placed peg to remove it;
  • tap a peg in a row already played to copy its color into the selected slot;
  • tap the copy icon to the left of a submitted row to copy the whole row.

Then you submit the row: the hints appear next to it, and the next row becomes the current row.

Reading the hints

By default, a small black peg marks a correctly placed peg and a small white peg marks a misplaced peg. The hints are grouped together: their order does not match the order of the pegs in the guess.

Secret codered, yellow, blue, orange
Guessred, blue, purple, orange
Clues2 correctly placed, 1 misplaced

Here, the app answers “2 correctly placed, 1 misplaced.” It counts the correctly placed pegs first. Then, among the remaining pegs of the guess, it counts those whose color is still found elsewhere in the code. A color that is not in the code scores nothing.

All the right colors, none in the right place:

Secret codered, yellow, blue, orange
Guessorange, blue, yellow, red
Clues4 misplaced

Repeated colors

In the code, a color appears at most once at the Easy and Intermediate levels, at most 2 times at the Hard level and at most 3 times at the Extreme level. In your guesses, you can repeat a color as many times as you like, at every level.

Each peg in the code counts only once. If your guess contains more copies of a color than the code does, the extra copies score nothing:

Secret codered, yellow, blue, orange
Guessred, red, red, red
Clues1 correctly placed

The code contains only one red peg, in its place: only one of your red pegs is counted, as correctly placed, and the others score nothing. It's the same at the Hard level, where the code can repeat a color:

Secret codeorange, yellow, yellow, orange, brown
Guessyellow, yellow, yellow, yellow, yellow
Clues2 correctly placed

The code contains 2 yellow pegs: only 2 of your yellow pegs count, and the others score nothing.

Incomplete rows

The app accepts a row as soon as one peg is placed: slots left empty give no hints. Only the last row must be complete to be submitted. An empty row can never be submitted.

Secret codered, yellow, blue, orange
Guessred, empty slot, blue, empty slot
Clues2 correctly placed

An incomplete row cannot win, since an empty slot is never correctly placed, and it uses up a row just like a complete guess.

Winning and losing

  • Win: all the pegs in a row are correctly placed. The winning row counts as one guess.
  • Loss: the last row is played without finding the code, for example after 10 rows at the Easy level.
End of a won Code Breaker game on a phone, light theme: a window announces that the code was found, shows the code, the number of guesses and a New game button, in front of the grid of guesses.
A won game.