Code rules and solving techniques
Code deduction is a logic puzzle and follows the classic code-breaking principle: a hidden colour code, and guesses at it scored with black and white pins.
It is played differently all the same. The guesses at the top of the board are not yours: they have already been made, already been scored, and they are part of the task. You do not guess, you work it out - and enter, exactly once, what the code must be. On striduel there are new tasks every day, free in the browser and playable without an account.
The rules
The hidden code is four slots long. Each slot carries one of several colours, and every colour also has a shape - circle, square, triangle, diamond, star, hexagon. The shape is not decoration: someone who tells colours apart poorly reads the shape, and the two mean the same thing.
Under each scored guess there are small pins. They say how good it was - but not where:
- A black pin means: one colour sits in the right place. Which one, it does not say.
- A white pin means: a colour occurs in the code, but here it is in the wrong place.
- No pin for a colour means it does not occur in the code at all.
The order of the pins means nothing. They are a count, not a pointing finger - and that is where the whole of the thinking comes from.
On the lower tiers the code holds no colour twice; on hard it may. The scored guesses may always repeat a colour - the rule restricts the code, not the questions asked of it.
Strategy: three inferences that always hold
What you reason about here is not a single slot but the set of codes still possible. Every scored row cuts a piece out of it; once one code is left, it is the answer.
- Elimination. A row scores two black pins and no white one. Then two of its pegs sit in the right place, and the other two occur nowhere in the code. Every code that would score this row differently drops out by force - what is tested is the score, not the resemblance.
- Blank row. A row with no pin at all: none of its colours occurs in the code, in any place. The sharpest single inference in the game - and an edge case, because on the easy and medium tiers it cannot arise at all: with so few colours, a guess and the code must overlap.
- Only one left. Once a single code fits every row, it is the answer by force. The last step is a count, not a hunch.
When counting, the pins count pegs and not colours. A colour that appears twice in a guess and once in the code earns one pin, not two. Count colours instead and you will be wrong on every board where a guess repeats itself - and here, almost every guess does.
An example, step by step
A real board on the easy tier: four slots, four colours, none of them twice. That is 24 possible codes to begin with. Each scored row cuts something away; the number beside it says how much is left.
Step 1Elimination - Row 1 shows circle, diamond, square, circle and scores 2 black and one white pin: 2 pegs sit in the right place, one more hits a colour of the code in a wrong place. Every code that would score differently drops out. 20 of 24 codes are still possible.
Step 2Elimination - Row 2 shows circle, circle, square, circle and scores 2 black and no white pin: 2 pegs sit in the right place - and beyond those, no peg hits a colour that is still free in the code. 5 of 24 codes are still possible.
Step 3Elimination - Row 3 shows square, diamond, triangle, circle and scores no black pin but 4 white pins: 4 pegs hit a colour of the code, and yet not one of them sits in the right place. Of 24 codes, exactly one is left.
Step 4Only one left - After all 3 rows exactly one code is left that fits every one of them. No more is needed - and no fewer would have done. That settles the code: circle, triangle, square, diamond.
The techniques by name
These are the same names that appear above a hint you buy in the game. Unlike the grid puzzles, they do not name a cell - they name what a row does to the set of possible codes.
- Elimination. The normal case: a scored row fits some codes and not others. The others drop out. Every row on its own is harmless - only all of them together leave one standing.
- Blank row. A row with no pin at all rules out every colour it contains - in one stroke and for the whole code. It is the single strongest clue in the game and at the same time the rarest: on easy and medium it cannot occur at all, because with so few colours the guess and the code are bound to overlap.
- Only one left. Not a thinking step of its own but the end: if exactly one code survives every row, that is the solution.
One approach that almost always helps: start with the row that has the fewest pins. It says the most about what the code is not, and ruling out is cheaper here than confirming.
Practise it yourself
In practice mode you can play code deduction on its own, as often as you like and on the tier you choose. None of it counts towards a leaderboard - it is the place to try things out.