Canal View
Flood some cells to make one connected canal that never fills a 2×2 block. Every number stays dry, and counts the flooded cells it can see: walk out in the four directions and add up the runs that start next to it. A run stops at the first dry cell, and whatever is behind that cell is not counted. Click a cell to flood it, again to mark it dry, again to clear it.
the board
A number is not a statement about its row and column
The rule everyone reads first is "the number counts the black cells it can see in the four directions". The word doing the work is see: a run stops at the first dry cell, and whatever is behind that cell is not counted. So a number describes the near end of its four rays and nothing else — and one dry cell hides an unbounded amount of canal.
Measured over the 72 boards shipped here: an 8×8 number says 3.84 on average while 5.28 flooded cells actually sit in its four rays, so it is looking at 72.8% of them. At 12×12 that falls to 64.7%. The bigger the board, the more of it every number is blind to.
| board | a number says | flooded in its rays | share it sees | rays with canal behind the wall | hidden cells, mean | most hidden by one dry cell |
|---|---|---|---|---|---|---|
| 8×8 | 3.84 | 5.28 | 72.8% | 9.5 | 1.73 | 6 |
| 12×12 | 5.06 | 7.83 | 64.7% | 25.5 | 2.34 | 10 |
The last column is the one to look at: on a 12×12 board a single dry cell hides a run of 10 flooded cells from a number that is staring straight at it.
Count the sightlines twice
Every flooded cell is seen from at most one number per direction, so the pairs (number, flooded cell it sees) can be counted two ways: down the numbers it is the clue sum, across the cells it is at most four each. That is a floor on the size of the canal that costs no search at all, and the 2×2 rule is the ceiling — the largest 2×2-free subset of an h×w grid is hw − ⌊h/2⌋⌊w/2⌋, take every other row whole and every other cell of the rows between.
⌈Σ clues / 4⌉ ≤ canal ≤ hw − ⌊h/2⌋⌊w/2⌋
| board | floor from the clues | actual canal | ceiling from 2×2 | clue sum ÷ canal |
|---|---|---|---|---|
| 8×8 | 11 | 32.1 | 48 | 1.37 |
| 12×12 | 28 | 72.4 | 108 | 1.51 |
The sandwich is loose, and that is the interesting part. It would be tight if every flooded cell were seen from all four sides; measured, a flooded cell is seen 1.37 times at 8×8 and 1.51 times at 12×12. Splitting the missing sightlines says why — every (flooded cell, direction) pair is exactly one of three things.
| board | (cell, direction) pairs | seen | no number that way | a dry cell in between | blocked |
|---|---|---|---|---|---|
| 8×8 | 4,616 | 1,576 | 2,451 | 589 | 12.8% |
| 12×12 | 10,432 | 3,933 | 4,351 | 2,148 | 20.6% |
The second column is exactly four times the canal and the third is exactly the clue sum — the same identity, arrived at from the other side, and npm test checks it board by board. Occlusion alone accounts for 20.6% of all sightlines at 12×12, and it grows with the board.
| board | seen by nobody | by one | by two | by three | by four | flooded cells |
|---|---|---|---|---|---|---|
| 8×8 | 96 | 606 | 387 | 64 | 1 | 1,154 |
| 12×12 | 103 | 1,317 | 961 | 214 | 13 | 2,608 |
A ray is not 2m cells, it is m + 1 states
Whatever the answer turns out to be, a ray out of a number reads the same shape: a flooded cells, then a dry cell, then anything at all. A direction of length m therefore has m + 1 states rather than 2m, and a number's whole cross is one bounded composition of its value into four arms. That is the only thing the solver ever branches on.
| board | numbers | cells in a number's rays | 2cells | compositions that fit |
|---|---|---|---|---|
| 8×8 | 11.4 | 8.9 | 478 | 8.4 |
| 12×12 | 21.6 | 13 | 8,192 | 17.9 |
Which is why the complete solver is cheap: the median shipped 12×12 board is finished in 7 search nodes and the worst in 319, at 22.2 ms a board.
The canal is allowed to trap a lake
Nothing in Canal View says the dry cells have to join up, and they almost never do: a shipped 12×12 board walls off 12.1 dry regions from the outside on average, and 36 of 36 boards have at least one.
| board | canal | of the grid | lakes | boards with a lake | independent loops | boards with a loop |
|---|---|---|---|---|---|---|
| 8×8 | 32.1 | 50.1% | 3.5 | 36/36 | 2.1 | 35/36 |
| 12×12 | 72.4 | 50.3% | 12.1 | 36/36 | 6.8 | 36/36 |
A canal with a lake in it is a canal with a cycle, and "no 2×2" is exactly what makes a cycle possible without making it thick. The smallest shape that is 2×2-free without being a tree is the eight-cell ring — and at eight cells it is the only one. Counting fixed polyominoes both ways shows where the two ideas part company.
| cells | fixed polyominoes | no 2×2 block | tree-like | 2×2-free with a cycle |
|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 0 |
| 2 | 2 | 2 | 2 | 0 |
| 3 | 6 | 6 | 6 | 0 |
| 4 | 19 | 18 | 18 | 0 |
| 5 | 63 | 55 | 55 | 0 |
| 6 | 216 | 174 | 174 | 0 |
| 7 | 760 | 570 | 570 | 0 |
| 8 | 2,725 | 1,909 | 1,908 | 1 |
| 9 | 9,910 | 6,485 | 6,473 | 12 |
| 10 | 36,446 | 22,282 | 22,202 | 80 |
Columns two and four are published sequences — A001168 and A066158 — and npm run ledger refuses to write its output if the enumerator disagrees with either. Column three is what a canal actually has to be, and it is in neither.
For scale, every canal that fits in a small grid, counted once by testing all 2hw subsets and once by growing sets outwards from an anchor. The two counts have to match.
| grid | connected sets | also 2×2-free | share |
|---|---|---|---|
| 2×2 | 13 | 12 | 92.3% |
| 2×3 | 40 | 33 | 82.5% |
| 3×3 | 218 | 139 | 63.8% |
| 3×4 | 1,126 | 544 | 48.3% |
| 3×5 | 5,726 | 2,080 | 36.3% |
| 4×4 | 11,506 | 3,755 | 32.6% |
| 4×5 | 116,166 | 25,822 | 22.2% |
What holds a finished board still
Take a shipped answer and flip one cell. All 6,301 single-cell flips across the bank are illegal — but which rule catches them is not what the board looks like it is about.
| rule | flips it kills | flips only it kills |
|---|---|---|
| a number | 5,298 | 2,974 |
| the 2×2 rule | 932 | 197 |
| the canal joining up | 2,395 | 806 |
| nothing at all | 0 | — |
15.9% of the flips are caught by the 2×2 rule or by connectivity and by nothing else. Drop either rule and that many single-cell edits of the answer become legal on the spot — which is exactly what the misreading table below measures.
The ladder
Four rungs over the same compositions. The first pair of numbers is the share of cells the rung can name on its own, the second is the boards it finishes outright.
arm— arc consistency on the compositions: throw away every arm assignment the marks already contradict, then keep what all the survivors agree on.block— and three corners of a 2×2 flooded makes the fourth dry.flow— and the canal has to join up: flooded cells in two pieces that can no longer meet is a contradiction, a cell the canal can never reach is dry, and a cell whose loss would cut the canal in two is flooded. Plus the sandwich as a bound on what is left.search— the complete solver, branching on the most constrained number's compositions.
| rung | cells, 8×8 | cells, 12×12 | boards, 8×8 | boards, 12×12 |
|---|---|---|---|---|
arm | 54.6% | 41.9% | 0/36 | 0/36 |
block | 63.7% | 53.9% | 0/36 | 0/36 |
flow | 81.5% | 67.5% | 18/36 | 6/36 |
search | 100% | 100% | 36/36 | 36/36 |
The dial is how many numbers are left
Number every dry cell and the board says its own answer out loud. Rub numbers out at random from there and ask whether the answer is still alone.
| numbers kept, 8×8 | drawn | unique | rate |
|---|---|---|---|
| every dry cell | 108 | 108 | 100.0% |
| 26 | 108 | 83 | 76.9% |
| 22 | 108 | 54 | 50.0% |
| 18 | 108 | 21 | 19.4% |
| 15 | 108 | 6 | 5.6% |
| 12 | 108 | 0 | 0.0% |
| 10 | 108 | 0 | 0.0% |
| 8 | 108 | 0 | 0.0% |
| numbers kept, 12×12 | drawn | unique | rate |
|---|---|---|---|
| every dry cell | 108 | 108 | 100.0% |
| 56 | 108 | 61 | 56.5% |
| 44 | 108 | 7 | 6.5% |
| 36 | 108 | 4 | 3.7% |
| 30 | 108 | 0 | 0.0% |
| 26 | 108 | 0 | 0.0% |
| 22 | 108 | 0 | 0.0% |
| 18 | 108 | 0 | 0.0% |
The boards shipped here carry 11.4 numbers at 8×8 and 21.6 at 12×12. Rubbing out at random down to 12 numbers on an 8×8 gave 0 unique boards in 108 draws, and down to 22 on a 12×12, 0 in 108. Every number still on a shipped board is one whose removal was tried and refused.
And look at the top row of each table. Numbering every dry cell is not quite a guarantee: over 200 freshly drawn 8×8 canals, 3 still had a second answer, and in 3 of those 3 the cells that moved were exactly the ones no number was looking at. You can write the whole answer down and still not have said it.
Boards do not happen by accident
Numbers scattered at random, with values drawn either from the small range real boards use or from the whole range their rays allow:
| board | numbers | values | drawn | no answer | one answer | more |
|---|---|---|---|---|---|---|
| 8×8 | 11 | small | 200 | 193 | 0 | 7 |
| 8×8 | 21 | small | 200 | 200 | 0 | 0 |
| 8×8 | 11 | whole range | 200 | 198 | 0 | 2 |
| 8×8 | 21 | whole range | 200 | 200 | 0 | 0 |
| 12×12 | 17 | small | 200 | 126 | 0 | 74 |
| 12×12 | 31 | small | 200 | 200 | 0 | 0 |
| 12×12 | 17 | whole range | 200 | 200 | 0 | 0 |
| 12×12 | 31 | whole range | 200 | 200 | 0 | 0 |
Not one unique board in 1,600 draws. The interesting column is "no answer": unlike a puzzle drawn around an answer, a random board usually cannot be solved at all, because the counts it demands and the canal that would have to carry them do not fit together.
Four ways to misread it, and what each one does
| misreading | board | boards | intended answer still legal | answers, median | unique | none |
|---|---|---|---|---|---|---|
| the 2×2 rule dropped | 8×8 | 24 | 24/24 | 32 | 2 | 0 |
| 12×12 | 24 | 24/24 | ≥2,000 | 0 | 0 | |
| the canal allowed to break up | 8×8 | 24 | 24/24 | 1,248 | 0 | 0 |
| 12×12 | 24 | 24/24 | ≥2,000 | 0 | 0 | |
| the dry cells required to join up too | 8×8 | 24 | 0/24 | 0 | 0 | 24 |
| 12×12 | 24 | 0/24 | 0 | 0 | 24 | |
| the number read as its whole row and column | 8×8 | 12 | 0/12 | 0 | 0 | 11 |
| 12×12 | 12 | 0/12 | 0 | 0 | 12 |
The two halves of that table fail in opposite directions. Dropping a rule keeps the intended answer legal and buries it under hundreds of others, so nothing looks wrong until you notice that a second answer exists. Adding a rule that is not there — or reading the number as its whole row and column — makes the intended answer illegal: the board is empty, and you can spend a long time looking for an answer that is no longer there.
Two engines
The compositions are the load-bearing idea here, so they are checked against an engine that has never heard of them: walk the cells in reading order, try flooded then dry, prune only on a 2×2 that has already closed and on a number whose count can no longer land, and check the finished grid against the rules directly. On the 30 6×6 boards small enough for it to finish — 1,939,359 nodes of brute force — the two agree 30 times with 0 disagreements, and they agree on the answer set, not only the count. The same check runs with the 2×2 rule dropped, where the answers multiply into the hundreds: 30 agreements, 0 disagreements, 1,126 answers.