Cracking the hidden colour code with logic
How the feedback pegs work, what the three difficulty levels change, the opening guess that teaches you the most, and the reasoning that turns ten guesses into more than enough.

What you are solving
A sequence of coloured pegs is hidden behind a shield at the top of the board. You do not know which colours they are or where they sit. Your job is to work it out by making guesses and reading the feedback.
Each guess is a complete row of colours. After you submit it, a set of small feedback pegs appears beside it. Those pegs tell you how close you were, but they do not tell you which positions were right. That gap between what you know and what you need is the entire game.
The two kinds of feedback peg
A dark peg means one of your colours is exactly right, in the correct position. A pale peg means a colour appears in the hidden code but you put it in the wrong spot. No peg at all means that colour is not in the code, or every copy of it has already been accounted for.
The pegs are sorted. Their order has nothing to do with which slot they refer to. You might see two dark pegs and one pale peg, but you cannot tell from their position which of your four slots scored the dark pegs. That deliberate ambiguity is what makes the puzzle a deduction rather than a guess.
How duplicates are counted
If the hidden code has one red peg and you guess two reds, only one gets credit. The scoring works in two passes. First it checks exact matches and removes those from both sides. Then it looks at the remaining pegs and counts partial matches from what is left over. This prevents the feedback from awarding more matches than the code actually contains.
That two-pass count is what makes reasoning sound. If two reds in your guess produce only one pale peg, you know the code has exactly one red. A simpler count that checked each slot on its own could report two partial matches and mislead you into thinking the code had two.
The three difficulty levels
Easy uses four colours and a code that is four pegs long. No colour repeats, so every position holds a different hue. You have ten guesses. With only four colours and no repeats, there are just twenty-four possible codes. This is the level for learning how the feedback works.
Normal raises the palette to six colours and keeps the code at four pegs. Repeats are allowed, which expands the code space to 1,296 possibilities. You still have ten guesses, and with careful play five or six are usually enough.
Hard uses seven colours and stretches the code to five pegs. Repeats are still allowed, and you get twelve guesses. The longer code and wider palette make elimination slower, so the extra two guesses earn their keep.
Controls on the board
Below the board sits a row of coloured chips, one for each available colour. Tap a chip to place that colour in the next open slot of your current guess. The Undo button removes the last colour you placed, so you can correct a slip without starting the row over.
Once every slot in the row is filled, the Check button becomes active. Press it to submit the guess. The feedback pegs appear beside your row, the row locks in place, and the next blank row becomes the current one. You cannot go back and change a guess that has already been submitted.
Spend the first guess on information
A common beginner mistake is to aim the first guess at winning immediately. The odds of guessing a six-colour, four-peg code on the first try are less than one in a thousand. A guess chosen at random teaches you almost nothing when it misses.
Instead, use the first guess to learn which colours appear in the code. Place four different colours. The total number of dark and pale pegs tells you how many of those four are present. If you get two pegs, you know two of your four colours are in the code and two are not. That single number eliminates a large chunk of the search space before your second guess.
On Hard, with five slots and seven colours, you cannot test all seven in one row. Use the first two guesses to sweep through them. After two guesses you will know exactly which colours are in play.
Change one thing at a time
After your first guess, resist the urge to rebuild the whole row. Take the guess that gave you the most information and change a single peg. If the number of dark pegs goes up by one, the new colour in the new position is right. If it goes down, you moved something that was correct.
This one-change method is slow but airtight. Every guess tells you something specific about a single position. After three or four rounds of it, you will often know enough to fill in the rest by logic alone.
Tracking what you know
Every submitted guess stays visible on the board, with its feedback pegs beside it. Scroll up and look at them together. The guesses form a set of constraints, and the hidden code is the one sequence that satisfies all of them at once.
Pay attention to zeros. A guess that returns no pegs at all is extremely useful. It tells you that none of those colours appear in the code. On Normal, that wipes out four colours in one guess and leaves only two possibilities for every slot.
Keep track of which colours you have confirmed and which you have ruled out. The more colours you eliminate, the fewer candidates remain for each position, and the faster the answer narrows down.
When repeats change the logic
On Easy, every colour appears at most once. That makes elimination straightforward. Once you know a red is in the code, it occupies exactly one slot. Once you place it, red is done.
On Normal and Hard, a colour can appear more than once. One dark peg for red does not mean there is only one red. There could be two or three. You need to test for duplicates by guessing rows with repeated colours and reading the peg count carefully.
If you guess two reds and get one more peg than you expected, the code likely has a second red. If the count does not rise, one red is all there is. This duplicate testing adds a layer that Easy does not have, and it is where most Normal players lose time.
Mistakes that cost guesses
- Guessing randomly instead of building on what you know. Every guess should be shaped by the feedback so far.
- Changing too many pegs at once. You get a new peg count, but you cannot tell which change caused it.
- Forgetting that pegs are sorted. The leftmost dark peg does not refer to your leftmost slot.
- Ignoring zero-peg results. They are the most powerful eliminator in the game.
- On Normal and Hard, assuming no repeats. If you cannot place a confirmed colour in any open slot, it may appear in a slot you thought was a different colour.
A short example on Easy
Four colours are available, the code is four pegs long, and no colour repeats. Guess all four colours in order. Suppose the feedback is two dark pegs and two pale pegs. Every colour is in the code, so the job is to find the right positions.
Swap the first two colours and submit again. If the dark count goes up, one of those two is now in the right place and was wrong before. If it drops, one was already correct and you have just moved it out. Either way, you have learned which of those two slots holds which colour. Repeat the same trick with the other pair, and the code falls in three or four guesses total.
Nothing leaves your browser
The hidden code is picked by your own browser from a random number generator. No server knows the answer, no guess is uploaded, and no account is involved. Your best score is stored in this browser on this device and will not appear on any other machine. Once the page has loaded, the game works offline.
