Goishi Hiroi
Start on any stone and travel in a straight line, up, down, left or right. You must pick up the first stone you meet — you cannot skip one. On a stone you may turn, but you may never go back the way you came. A stone is gone once collected, so a square you have already emptied is a hole you fly over, and you cannot turn there. Clear the board. Click a stone to start, then click any highlighted stone to travel to it.
the board
An emptied square and a square that never held a stone are the same thing
Everything below rests on one line of the rules: a stone is gone once you pick it up. A traveller looking down a row cannot tell a square that was cleared from a square that was always bare — both are holes to fly over, and neither lets you turn. So how many ways there are to finish depends on the stones that are left, where you stand and which way you arrived, and not at all on which stones used to be there. One table f(remaining, position, arrival) therefore prices every stone layout on a grid at once, and a layout's answer count is just a sum of lookups into it. That is what makes the exhaustive censuses on this page possible: the 1,048,575 non-empty layouts of a 4×5 board are all counted in 827 ms.
| grid | stone layouts | can be cleared | have exactly one answer | genuine puzzles (≥2 stones) | sweep |
|---|---|---|---|---|---|
| 1x6 | 63 | 63 (100.0%) | 6 | 0 | 0 ms |
| 1x8 | 255 | 255 (100.0%) | 8 | 0 | 1 ms |
| 1x10 | 1,023 | 1,023 (100.0%) | 10 | 0 | 2 ms |
| 1x12 | 4,095 | 4,095 (100.0%) | 12 | 0 | 3 ms |
| 2x3 | 63 | 49 (77.8%) | 6 | 0 | 0 ms |
| 2x4 | 255 | 183 (71.8%) | 8 | 0 | 0 ms |
| 2x5 | 1,023 | 691 (67.5%) | 10 | 0 | 1 ms |
| 2x6 | 4,095 | 2,641 (64.5%) | 12 | 0 | 3 ms |
| 2x7 | 16,383 | 10,197 (62.2%) | 14 | 0 | 13 ms |
| 2x8 | 65,535 | 39,691 (60.6%) | 16 | 0 | 39 ms |
| 2x9 | 262,143 | 155,479 (59.3%) | 18 | 0 | 175 ms |
| 2x10 | 1,048,575 | 612,069 (58.4%) | 20 | 0 | 761 ms |
| 3x3 | 511 | 352 (68.9%) | 9 | 0 | 2 ms |
| 3x4 | 4,095 | 2,718 (66.4%) | 24 | 12 (0.29%) | 1 ms |
| 3x5 | 32,767 | 21,788 (66.5%) | 275 | 260 (0.79%) | 10 ms |
| 3x6 | 262,143 | 177,437 (67.7%) | 3,582 | 3,564 (1.36%) | 99 ms |
| 4x4 | 65,535 | 44,571 (68.0%) | 416 | 400 (0.61%) | 25 ms |
| 4x5 | 1,048,575 | 751,237 (71.6%) | 10,316 | 10,296 (0.98%) | 738 ms |
A one-stone board is trivially its own answer, so the last column drops those. It is the interesting column, and on more than half of these grids it reads zero.
A board is a puzzle only if its answer dies when you read it backwards
Take any clearance and run it in reverse. The "never go back the way you came" clause is symmetric in time, so that is not what breaks. What breaks is the holes. Going forward, a move may fly over a stone you collected ten moves ago; going backwards that stone has not been collected yet, and it blocks the way. So a clearance reversed is again a clearance exactly when no move in it ever flew over a square it had already emptied. Call such a clearance clean.
That single sentence decides which boards can be published. If a board's only answer were clean, its reverse would be a second, different answer — so a board with exactly one answer must contain a fly-over. The census checks it rather than taking it on faith: across every layout of the grids below, the number of one-answer boards whose answer is clean is 0.
| grid | layouts examined | clearable | one answer | clearable with a clean answer | all answers clean | one answer that is clean |
|---|---|---|---|---|---|---|
| 2x4 | 247 | 175 | 0 | 175 (100.0%) | 147 (84.0%) | 0 |
| 2x5 | 1,013 | 681 | 0 | 681 (100.0%) | 545 (80.0%) | 0 |
| 2x6 | 4,083 | 2,629 | 0 | 2,629 (100.0%) | 2,033 (77.3%) | 0 |
| 3x3 | 502 | 343 | 0 | 339 (98.8%) | 271 (79.0%) | 0 |
| 3x4 | 4,083 | 2,706 | 12 | 2,616 (96.7%) | 1,996 (73.8%) | 0 |
| 4x4 (119,979 sampled) | 119,979 | 81,431 | 752 | 75,327 (92.5%) | 58,753 (72.2%) | 0 |
| 4x5 (120,000 sampled) | 120,000 | 86,196 | 1,165 | 76,618 (88.9%) | 62,011 (71.9%) | 0 |
The shipped boards say the same thing from the other side: every one of them carries at least one fly-over, because it had to. The 8×8 boards average 2.1 of them across 504 moves, which is 10.1% of all moves made.
Which is why small boards hold no puzzles at all
A fly-over needs three stones in a line and a route that collects the middle one early, and on a cramped board there is not enough room to arrange one that also kills every other route. The census walks every layout and finds the floor exactly. No board one row deep holds a puzzle at any width up to 12, and none two rows deep at any width up to 10; 3×3 holds none; 3×4 is the smallest grid that holds any, and it holds exactly 12.
There is a second floor, and it does not move. Across every grid measured, no layout of two to six stones has ever had exactly one answer — the smallest genuine puzzle in this game is seven stones, on every grid where one exists at all. Nor does the sweet spot drift: uniqueness peaks near half the squares.
| grid | stones in the smallest puzzle | stone count with the most puzzles | puzzles there | share of clearable layouts at that count |
|---|---|---|---|---|
| 3x4 | 7 | 7 of 12 | 12 | 1.83% |
| 3x5 | 7 | 8 of 15 | 120 | 2.52% |
| 3x6 | 7 | 9 of 18 | 1,128 | 3.38% |
| 4x4 | 7 | 8 of 16 | 192 | 2.17% |
| 4x5 | 7 | 10 of 20 | 3,464 | 2.45% |
Clearing a board with a stone on every square
Fill the grid completely and the answer count becomes a clean sequence. A single row has exactly two clearances however long it is — start at one end, walk to the other — and those two are each other reversed, which is the whole reversal argument in miniature. Two rows behave much less simply.
| grid | ways to clear it | grid | ways to clear it |
|---|---|---|---|
| 2x2 | 8 | 1x2 | 2 |
| 2x3 | 20 | 1x3 | 2 |
| 2x4 | 60 | 1x4 | 2 |
| 2x5 | 172 | 1x8 | 2 |
| 2x6 | 508 | 1x16 | 2 |
| 2x7 | 1,500 | 3x3 | 64 |
| 2x8 | 4,460 | 3x4 | 400 |
| 2x9 | 13,292 | 3x5 | 2,004 |
| 3x6 | 11,936 | ||
| 4x4 | 6,984 |
The 2×n column satisfies a(n) = 4·a(n−1) − a(n−2) − 6·a(n−3) on every term computed, and the tests re-derive each term from the search rather than from the recurrence. None of these sequences is in the OEIS.
The cheapest clause in the rules is not the cheapest to delete
"You may not go back the way you came" is eight words and looks like a tidying-up rule. Delete it and re-run the whole census: more layouts become clearable, and — the surprise — more layouts end up with exactly one answer, because boards that had no answer at all acquire exactly one. The clause is not mainly a filter on answers; it is a filter on which boards are alive.
| grid | clearable, real rules | clearable, clause deleted | one answer, real rules | one answer, clause deleted | unique under both |
|---|---|---|---|---|---|
| 3x4 | 2,718 | 3,259 (+19.9%) | 24 | 232 | 12 |
| 3x5 | 21,788 | 27,274 (+25.2%) | 275 | 1,351 | 15 |
| 3x6 | 177,437 | 227,637 (+28.3%) | 3,582 | 6,522 | 18 |
| 4x4 | 44,571 | 54,427 (+22.1%) | 416 | 2,928 | 112 |
| 4x5 | 751,237 | 917,043 (+22.1%) | 10,316 | 29,980 | 1,444 |
The generator cannot sample. It has to climb
There are no clues to place and nothing to minimise here: the board is the stone layout, and moving one stone rewrites every move of the answer. The obvious generator — lay stones down and test — dies fast, and it dies on the stone count rather than on the board size.
| grid | stones | layouts tested | with exactly one answer | hit rate |
|---|---|---|---|---|
| 6×6 | 8 | 1,438 | 28 | 1.95% |
| 6×6 | 10 | 2,044 | 29 | 1.42% |
| 6×6 | 12 | 2,541 | 16 | 0.63% |
| 6×6 | 14 | 2,947 | 3 | 0.10% |
| 6×6 | 16 | 3,237 | 2 | 0.06% |
| 6×6 | 18 | 2,594 | 0 | 0.00% |
| 8×8 | 14 | 2,232 | 10 | 0.45% |
| 8×8 | 18 | 2,210 | 1 | 0.05% |
| 8×8 | 22 | 1,882 | 0 | 0.00% |
So the generator builds the answer first. It walks a route stone by stone; any square the walk flies over that has not been decided yet is banned — it must stay empty forever, or a stone placed there later would block a move already committed to. That yields a layout that is at least clearable. Then a hill-climb relocates one stone at a time, keeping any move that does not raise the number of answers, until one is left. On 8×8 with 22 stones, rejection sampling landed a puzzle not once in 1,882 layouts; the climb gets there in a median of 43 answer counts.
| shipped board | stones | answer counts spent | relocations kept | restarts needed |
|---|---|---|---|---|
| 6x6 | 14 | median 17, worst 141 | median 6 | median 1 |
| 8x8 | 22 | median 43, worst 137 | median 11 | median 1 |
| 10x10 | 30 | median 99, worst 177 | median 38 | median 1 |
The ladder, measured both ways
The hint button runs one of five rungs. line is the rules and nothing else. reach notices that every real move joins two stones sharing a row or a column, so the stones still out there must stay connected in that relaxed graph. dead adds the shape of that graph: what remains has to be walked as a path, so it can afford at most two stones of degree one, and a low-degree stone that does not share a line with where you stand can only ever be the last. probe plays each move and lets the cheaper rungs speak. search is the search itself.
Read forwards, a rung is worth the share of the moves along the answer where it leaves exactly one legal move — no guessing needed.
| rung | 6x6: moves it settles | 8x8: moves it settles | 10x10: moves it settles | 6x6: boards it finishes alone | 8x8: boards it finishes alone | 10x10: boards it finishes alone |
|---|---|---|---|---|---|---|
line | 66.7% | 59.9% | 59.1% | 0 of 24 | 0 of 24 | 0 of 24 |
reach | 72.8% | 65.7% | 61.9% | 0 of 24 | 0 of 24 | 0 of 24 |
dead | 73.7% | 67.5% | 63.5% | 0 of 24 | 0 of 24 | 0 of 24 |
probe | 80.4% | 71.6% | 65.7% | 0 of 24 | 0 of 24 | 0 of 24 |
search | 100.0% | 100.0% | 100.0% | 24 of 24 | 24 of 24 | 24 of 24 |
Read as pruning, the same rungs are worth the search nodes they delete when proving a shipped board has only one answer.
| rung | 6x6: median nodes | 8x8: median nodes | 10x10: median nodes | 6x6: worst | 8x8: worst | 10x10: worst |
|---|---|---|---|---|---|---|
line | 2,078 | 64,029.5 | 1,400,855 | 4,655 | 103,505 | 3,329,017 |
reach | 326.5 | 7,443 | 78,181.5 | 1,232 | 18,931 | 229,632 |
dead | 241.5 | 4,759 | 40,897.5 | 1,017 | 14,168 | 138,990 |
probe | 169 | 3,445 | 29,568.5 | 688 | 10,775 | 101,477 |
The shipped boards
| board | boards | stones | moves | turned 90° | carried straight on | fly-overs | longest single move | stones that can open it |
|---|---|---|---|---|---|---|---|---|
| 6x6 | 24 | 14 | 312 | 201 (69.8%) | 87 | median 1, max 2 | median 4.5, max 5 | 1–1 |
| 8x8 | 24 | 22 | 504 | 330 (68.8%) | 150 | median 2, max 4 | median 6, max 7 | 1–1 |
| 10x10 | 24 | 30 | 696 | 436 (64.9%) | 236 | median 3, max 8 | median 8, max 9 | 1–1 |
The first move of a board has no predecessor, so the turn columns are counted over moves minus boards. Every shipped board opens on exactly one stone, and every one of them carries a fly-over — not by editorial choice but because a board without one cannot have a single answer. The stone you are standing on is also the only thing that tells you where you may go next, which is why the cheap rungs stall around 64% on the largest boards: two thirds of the moves along the answer are forced, and the rest need the search.