Code Breaker
Deduce a hidden row of colored pegs. Each guess tells you two counts: how many pegs are the right color in the right place, and how many are the right color somewhere else. Crack the code before you run out of guesses.
Players
One codebreaker. The vault sets the code and scores every guess. You play the vault itself: cracking the code wins, and anything else — including giving up — is a loss.
Setup
The vault seals a code before you see the board.
•
The code is 4 pegs long, unless you choose 3, 5, or 6.
•
The palette is 6 colors, unless you choose 4 (a shorter puzzle), 5, or 8.
•
Repeats are allowed in the code, unless you turn them off. With repeats off, every position is a different color, so the code cannot be longer than the palette.
•
You get 10 guesses, unless you choose 6, 8, or 12.
•
The same seed always seals the same code. Share the puzzle so a friend opens that code, unsolved.
At a table, seal the code by drawing instead of letting the vault choose. With repeats on, draw one peg per position from a bag that holds one of each color and put it back. With repeats off, shuffle the colors and lay the first ones face down. Scoring is the same either way.
Each color is a letter as well as a hue, so the code can be read without relying on color:
A shorter palette uses the letters from the top of that list.
A turn
Fill the glowing row, one color per position, then press Submit guess.
•
The guess must fill every position. A short row cannot be submitted, and it does not spend a guess.
•
Remove lifts the last peg.
•
A guess may repeat a color even when the secret code was sealed without repeats.
How a guess is scored
The vault returns two counts. It never tells you which positions they came from.
1.
An exact peg for each position where your color matches the code.
2.
A color peg for each remaining peg that matches a remaining code peg of that color.
Each of your pegs and each code peg is used at most once. Exact matches are taken first. A color is never credited more times than it still appears in the code after those exact matches.
The two counts appear beside the row, as dark pips (exact) and light pips (color), and as a line such as "2 exact, 1 color".
End of the code
•
Every position exact, and the vault opens. The code is shown, with how many guesses it took.
•
The last guess spent without an all-exact row, and the vault holds. The code is shown anyway.
Either way the puzzle is over. Start a new game for a new code, or share this one so someone else can try the same code.