Visibility Shading Puzzle Generator
A visibility shading puzzle prints a grid where some squares carry a number, and a numbered square is never shaded. Shade some of the rest so that no two shaded squares touch, and so every unshaded square can be reached from every other through unshaded squares — one connected region, with no pocket cut off by shading. Each number then says exactly how many unshaded squares it can see: look outward from it in each of the four directions, counting unshaded squares until a shaded square or the grid's edge blocks the view, then add one for the numbered square itself. A single number's count can depend on a shaded square many squares away, which is what makes this different from this site's other shading puzzles. Every grid here is checked to have one answer and no other.
What this generator does
Grows a shading at random, one square at a time, keeping only additions that leave the unshaded squares connected — correct by construction rather than checked afterwards — then clues every unshaded square with its true visibility count and thins those numbers one at a time, keeping a removal only while the remaining numbers still pin the whole grid down to a single answer.
How to use this tool
- Choose a grid size, then print or copy it.
- Shade squares so no two shaded squares share an edge — touching at a corner is allowed.
- Keep every unshaded square reachable from every other through unshaded squares.
- Check that every number counts itself plus the unshaded squares it can see in each direction before a shaded square or the edge blocks the view.
- Show the answer to check the finished grid.
Understanding the controls
- Grid
- Five to eight squares a side. A nine-square grid was measured to sometimes take over four seconds to prove unique, which is why it stops at eight.
- Seed (optional)
- Type anything to rebuild the same puzzle later, which is how you reprint a page you have lost. The seed makes the puzzle repeatable; it carries no cryptographic strength and is not a secret.
Common use cases
- A shading puzzle where a single number can constrain squares far down its own row or column
- A printable page that needs no key to explain it — every clue is a number counting what it can see
- A change of pace from this site's region-based and island-sizing shading puzzles
- Good practice at looking down a whole row before committing, since one clue can decide squares nowhere near it
- Reprinting the identical grid later from its seed
How this generator works
A number here is read along a line of sight that keeps going until something blocks it, unlike this site's other shading puzzles where a number sizes a local island or bounds a fixed region — so a single number can depend on a shaded square many squares away, and checking it only once every square on its line is decided was measured to take up to two seconds at six squares a side and not finish a seven at all in reasonable time. What fixed it: every time a square is shaded, every number sharing its row or column gets a cheap two-sided bound recomputed on the spot — a minimum from the unshaded squares already confirmed on each of its four sides, and a maximum that generously assumes every still-undecided square on that side turns out unshaded. The moment a number's printed value falls outside its own current bound, that branch is dropped immediately rather than explored to the end of the line. Whether the unshaded region has already split into two pieces is checked the same way, after every square a branch shades, treating undecided squares as if they could still be unshaded so a branch is only cut once even that generous reading is already broken. Measured after the fix: eight squares a side settles in on the order of a tenth of a second at its worst over forty seeded attempts, while nine was measured to reach 4.5 seconds on its worst of eight tries.
Randomness and fairness
The shading and which numbers survive thinning both come from your browser's cryptographic random source. Giving a seed replaces that source with a repeatable one, so the same puzzle can be printed again; the seed is for reproducibility, not cryptographic strength.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- The grid stops at eight squares a side — a measured limit: a nine-square grid was found taking up to 4.5 seconds to prove its numbers unique, against roughly a tenth of a second at eight.
- Difficulty is not graded. A grid can be led by its numbers from the first move, or need a section worked out before it opens up.
- A number only ever reports a total count along its own row and column, never which direction most of that count came from, so two different shadings near a number can look equally plausible until the connectivity rule rules one out.
- A fifth of the grid is shaded, to the nearest square: 5 squares at five a side, 7 at six, 10 at seven, 13 at eight.
Privacy and your data
The shading, the numbers and the check that they are unique are all done entirely in your browser. Nothing you type as a seed, and no puzzle made from it, leaves the device.
Related generators
- Magnetic Polarity Puzzle GeneratorPrints a grid already cut into dominoes — give each one a plus and a minus, or leave it blank, so no two touching cells share a sign and every row and column meets its printed count.
- Light Up Puzzle GeneratorAkari grids where every square must be lit, no bulb may light another, and only one arrangement works.
- Hitori Puzzle GeneratorShade out the repeats without letting two shaded cells touch or the rest come apart, with a single answer proved by construction and by search.
- Shikaku Puzzle GeneratorCut the grid into rectangles, one number in each, that number being its area — with the single answer proved before you see it.
- Tatamibari Puzzle GeneratorCut the grid into rectangles, one shape symbol in each — square, wider than tall, or taller than wide — with no four rectangles allowed to meet at a single point.
- Country Road Puzzle GeneratorDraw one loop along the grid lines that puts every numbered square inside it, where each number counts the inside squares it can see along its own row and column.