Solving guides

From the rulebook

How to Solve Code Grid

Code Grid gives you a fixed grid of digits and a hidden solution grid that uses exactly the same digits, just rearranged. Every row and column comes with three clue counts, exact, misplaced and absent, that tell you how the digits in that line compare to the hidden answer. This guide takes you from the rules to a full worked solve so you can see the techniques in action.

Play Code Grid

The rules of Code Grid

The source grid is fixed and never changes. Your answer grid starts empty and must be filled using exactly the digit inventory shown in the source grid, the same digits, the same quantity of each, just placed in different cells. You cannot use a digit more times than it appears in the source, and every digit in the source must be used somewhere in the answer.

Each row and each column carries three counts. Exact is how many of that line's source digits already sit in their correct cell in the hidden answer. Misplaced is how many more of that line's source digits appear somewhere else in the answer line, just in a different cell. Absent is how many of that line's source digits do not appear anywhere in the answer line at all. The three counts always add up to the line's length, and the marks are shown in that fixed order, exact, misplaced, then absent, as a display convention only. They never point at specific cells.

Read a pure rearrangement line

When a line's absent count is zero, every digit from the source line reappears somewhere in the answer line. Nothing was swapped out. That narrows the whole line to a rearrangement problem: you already know the exact multiset of digits that belongs there, you just need to work out which cell holds which digit.

If the exact count on that same line is also zero, none of the digits landed back in their original spot, so you can rule out every candidate arrangement that repeats even one source digit in its original cell. That single fact often eliminates most of the possible orderings in one step.

Cross rows and columns to narrow candidates

A row clue alone often leaves more than one possible arrangement, and the same is true for a column. The way to close the gap is to line up a row's candidate arrangements against a column's candidate arrangements at the cell where they cross, and keep only the combinations where both the row clue and the column clue check out at once.

This cross-checking is the main engine of Code Grid. Work out the candidates for one line, test them against a crossing line, discard anything that fails either clue, and repeat. Each cell you pin down that way immediately restricts every other line that passes through it.

Exhaust a clue to stop searching

Once a line's exact count and misplaced count together equal every digit that line shares with the source, in other words once exact plus misplaced equals the line's total overlap with the source digits, you know there is nothing left to find in that line. If a candidate arrangement already accounts for the exact count, you can immediately rule out any other cell in that line matching its own source digit, since the clue has already been exhausted.

This is especially powerful when misplaced is zero. A misplaced count of zero on a line whose exact count is already fixed means every shared digit in that line is already sitting in the one correct cell the clue allows, so the rest of that line is settled without checking further arrangements.

Count the shared inventory as you go

The digit bank below the grid shows how many of each digit remain unplaced. Every placement lowers its digit's remaining count by one, and the bank is shared across the whole grid, not per row or column. When a digit's remaining count reaches zero, it cannot appear in any other empty cell, which is often the deciding fact between two otherwise equally valid candidate arrangements.

Keep an eye on the bank in the final few cells of a solve. Once every digit but one is placed, the last empty cells are forced, since only one digit and one count remain to distribute between them.

A full worked 3 by 3 solve

Take a source grid of 0 2 1 on row one, 2 0 3 on row two and 1 3 0 on row three, giving a shared digit inventory of three 0s, two 1s, two 2s and two 3s. The row clues read 0 exact, 3 misplaced, 0 absent for row one, 1 exact, 2 misplaced, 0 absent for row two, and 0 exact, 3 misplaced, 0 absent for row three. The column clues read 1 exact, 0 misplaced, 2 absent for column one, 0 exact, 2 misplaced, 1 absent for column two, and 0 exact, 2 misplaced, 1 absent for column three.

Row one and row three both have zero absent, so each is a pure rearrangement of its own source digits, and their zero exact count rules out any arrangement that leaves a digit in its original cell. Row one's source digits are 0, 1 and 2, so the only two arrangements with no digit fixed in place are 0, 1, 2 and 1, 2, 0. Row three's source digits are 0, 1 and 3, and the same reasoning leaves 0, 1, 3 and 3, 0, 1 as its only two candidates.

Row two also has zero absent but one exact hit, so one of its three source digits, 2, 0 and 3, already sits in its correct cell. Checking every arrangement of those three digits against that single fixed point leaves three candidates: 0, 2, 3 and 2, 3, 0 and 3, 0, 2.

Column one's source digits are 2, 2 and 1, and its clue reads 1 exact and 0 misplaced, so exactly one shared digit exists between column one's source and answer, and it already sits in the correct cell, with nothing left over to place elsewhere in that column, the exhausted clue from the previous section. Testing the row candidates against column one keeps only row one as 0, 1, 2 and row two as 2, 3, 0, since every other pairing either shares no digit with column one at all or shares more than the single exact hit the clue allows.

With row one and row two pinned, row three is forced to 3, 0, 1 by the digit inventory, since 0, 1, 3 would repeat digits already exhausted from the shared bank in the wrong columns. Reading down confirms every column clue at once, column one becomes 0, 2, 3, column two becomes 1, 3, 0 and column three becomes 2, 0, 1, and the digit bank empties out exactly as the puzzle guarantees.

Frequently asked questions

What is Code Grid?
Code Grid is a logic puzzle where a fixed source grid of digits hides a solution grid that uses the exact same digits, just rearranged into different cells. Every row and column comes with exact, misplaced and absent counts that compare the source line to the hidden answer line, and you use those counts to work out where every digit belongs.
What do exact, misplaced and absent mean in Code Grid?
Exact counts how many digits in a line already sit in their correct cell in the hidden answer. Misplaced counts how many more of that line's digits appear somewhere else in the answer line, in a different cell. Absent counts how many of that line's digits do not appear anywhere in the answer line at all. The three always add up to the line's length, and the display order, exact then misplaced then absent, is a fixed convention rather than a way of pointing at specific cells.
How do you start a Code Grid puzzle?
Look for a row or column with zero absent, since that tells you the whole line is a rearrangement of its own source digits with nothing swapped out. Combine that with the exact count, since zero exact on a line rules out every arrangement that leaves a digit in its starting cell. Then cross-check candidates from a row against candidates from a crossing column and keep only the combinations that satisfy both clues.
What is the digit inventory rule in Code Grid?
The answer grid must use exactly the same digits as the source grid, the same quantity of each, just placed differently. The shared digit bank below the grid tracks how many of each digit remain unplaced, and once a digit's count reaches zero it cannot appear in any other empty cell, which often settles the last few placements of a solve.
Does solving Code Grid ever require guessing?
No. Every Puzzle Lair Code Grid puzzle is generated and verified to have exactly one solution reachable by pure logic. Being stuck means there is a deduction you have not spotted yet, often a line with zero absent you have not treated as a rearrangement or a crossing column whose exact count you have not exhausted.
Ready to play? Start a Code Grid puzzle

Confirm action