Room Shading Puzzle Generator
A room shading puzzle cuts the grid into rectangular rooms, and every room carries a number: how many of that room's own squares end up shaded. Two shaded squares may never sit next to each other, and every unshaded square must be reachable from every other through unshaded squares. The rule that catches people out is the third one: a straight run of unshaded squares, along one row or one column, may not pass through more than two rooms — so a shading can satisfy every room's count and still be wrong, if an unbroken corridor of unshaded squares threads through three rooms in a line. Every grid here is checked to have one answer and no other.
What this generator does
Cuts the grid into rectangular rooms, draws one genuine random shading for that exact layout — obeying the no-touching rule, connectivity and the run rule as it goes, not checked afterwards — clues every room with its true count, then proves by exhaustive search that those clues allow exactly one shading before publishing.
How to use this tool
- Choose a grid size, then print or copy it — the thicker lines mark room walls.
- Shade squares so each numbered room contains exactly that many shaded squares.
- Keep every shaded square isolated from every other by at least one unshaded square.
- Check that no straight run of unshaded squares crosses more than two rooms.
- Confirm every unshaded square can be reached from every other through unshaded squares.
- Show the answer to check the finished grid.
Understanding the controls
- Grid
- Six or seven squares a side. A larger grid was measured to sometimes take twenty seconds or more to prove unique, which is why it stops at seven.
- 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 with a genuine second rule beyond the count itself
- A printable page where the room borders do the work, so it survives being reduced to half a sheet
- Good practice at reading two rules at once, since a room satisfied on its own count can still break the three-room run rule
- A change of pace from a nonogram or a hitori
- Reprinting the identical grid later from its seed
How this generator works
Two things about this puzzle only showed up under measurement. First, drawing a shading at random, cell by cell, and only afterwards checking whether it happens to keep the unshaded squares connected and every run within two rooms: this was measured to succeed zero times in five hundred attempts on a six-square grid, because nothing about an independent per-cell coin flip favours breaking up a long corridor exactly at a room wall. So the shading is instead drawn by the same search that later proves it unique, with every room unclued and its branch order shuffled — the no-touching rule, each room's eventual clue, and the run rule (tracked as a running pair of "rooms seen since the last shaded square" along every row and column) all prune the search as each square is settled, rather than being checked on a finished grid. Second, connectivity genuinely cannot be checked early — a pocket of unshaded squares only reveals whether it is cut off once every square is decided — and on an awkward room layout that one deferred rule can still force the search through an enormous number of dead ends: an eight-square grid was measured not to finish inside twenty seconds. Every search here therefore carries a hard limit on how many squares it will try before giving up on that attempt and trying a fresh layout instead, which is also why eight is not offered. Measured at zero failures over one hundred and fifty seeded attempts at each offered size, worst case a little over a second.
Randomness and fairness
The room layout and the shading 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 seven squares a side — a measured limit, not a preference: an eight-square grid was found that had not finished proving itself after twenty seconds.
- Difficulty is not graded. A grid can be led by its rooms from the first move, or need a section worked out before it opens up.
- Every room here is clued, so there is no thinned-clue variant the way some other shading puzzles on this site offer.
- Room shapes are always rectangles rather than irregular blocks, since the layout is built the same way this site's rectangle-division puzzle builds its regions.
Privacy and your data
The room layout, the shading and the check that it is 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
- 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.
- Rotational Symmetry Puzzle GeneratorPrints a grid of dots — draw walls so every dot sits alone in its own region, and rotating that region 180 degrees about its own dot maps it exactly onto itself.
- Tapa Puzzle GeneratorPrints a Tapa grid where each clue counts the runs of shaded squares around it, with exactly one wall that fits.
- 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.
- Nurikabe Puzzle GeneratorNurikabe grids where each number is an island of that size, the wall is one piece, and no two-by-two block is allowed.
- Light Up Puzzle GeneratorAkari grids where every square must be lit, no bulb may light another, and only one arrangement works.