Divided Rooms

The grid arrives already divided into rooms, and the puzzle is to shade squares so each room takes the right number of them. What is left unshaded has to stay joined up as one corridor, and no straight white run may carry on too far across the walls.

How to play

A square takes three taps to get back where it started: dark, then pencilled in as staying light, then clear.

  1. Read the room numbers The number in the top left of a room is how many squares in that room end up painted. Rooms with no number can hold any amount.
  2. Paint and mark Tap once for a painted square and again for a light one. Marking the light squares is what makes the corridor rule visible.
  3. Keep painted squares apart Two painted squares may never touch side by side. They may touch at a corner.
Full instructions

In depth

Shading rooms without breaking the corridor

Four rules govern every grid, and only one of them is unusual. This guide walks through each rule with concrete examples, explains the tap controls, covers the three grid sizes, and lays out a solving method that handles the corridor constraint without guessing.

Screenshot: How to play Divided Rooms
How to play Divided Rooms as it appears when the page opens.

The four rules at once

The grid is divided into rectangular rooms by thick borders. You paint some squares dark. A valid solution satisfies four rules at the same time. First, a numbered room holds exactly that many painted squares. Second, no two painted squares touch side by side. Third, all unpainted squares are joined together so you can walk from any one to any other using side steps. Fourth, no straight run of unpainted squares passes through three or more rooms.

The first three rules appear in other shading puzzles. The fourth is what makes Divided Rooms its own thing. A corridor of light squares may sit inside one room. It may cross one room border and straddle two rooms. The moment it would enter a third room, something along that corridor must be painted to break it up.

How the taps work

Tap a square once and it turns dark. That means you believe it should be painted in the final answer. Tap it again and it becomes marked as light, shown with a different background. That second state is for your own reasoning. Marking a square light tells you that you have decided it stays unpainted, which helps you track the corridor rule. Tap a third time and the square returns to its blank state.

The grid size dropdown offers three settings. A five by five grid is the smallest and generates quickly. A six by six is the default and offers a balanced challenge. A seven by seven is the largest available and the puzzles there are harder, with more rooms and longer corridors to manage. Sizes above seven are not offered because the generator cannot reliably prove that exactly one answer exists at that scale.

Starting with small numbered rooms

A room of two squares with the number one in it is the simplest case. One of the two squares must be painted, and the other must stay light. Pick either square, paint it, and mark the other light. Now look at the painted square. Every square that touches it on a side must be unpainted, because no two painted squares may sit side by side. Mark those neighbours light as well.

A room of two squares with the number zero is even easier. Nothing in that room is painted, so mark both squares light at once. Two squares of guaranteed corridor is strong information. Any straight run that passes through those two squares and through one more room on each side is now at risk of touching three rooms. Something in the neighbouring rooms must be painted to break that run.

A room of four squares with the number two is trickier. Two of the four must be painted, but the two painted squares cannot touch. In a two by two room, the only option is to paint opposite corners, like the top-left and bottom-right, or the top-right and bottom-left. Which diagonal is correct depends on the surrounding rooms.

The corridor rule in practice

Draw a straight horizontal or vertical line through the grid. Follow it square by square. As long as the squares are unpainted, keep going. Count how many rooms the line passes through. If that count reaches three, the corridor is illegal and something in it must be painted.

Here is a concrete example on a six by six grid. The top row has three rooms. A room of three squares on the left, a room of two squares in the middle, and a room of one square on the right. If all six squares in the top row are light, that row passes through three rooms, which violates the rule. At least one square in the top row must be painted, and it must break the run so that no remaining segment touches three rooms.

The rule only cares about straight lines. A path of light squares that turns a corner can wander through as many rooms as it wants. The rule is about unbroken horizontal or vertical runs, nothing more.

Keeping the white squares connected

Every light square must be reachable from every other by stepping side to side through other light squares. A painted wall that seals off a pocket of unpainted squares on one side is wrong, even if every other rule holds.

This rule rarely triggers on its own. More often it stops you from painting too aggressively. If you paint a square that splits the light region into two islands, that square cannot be painted. Look for pinch points, squares where the light region narrows to a single path. Those squares must stay unpainted or the connection breaks.

On larger grids this becomes harder to see. A useful habit is to trace a path from one corner of the grid to the opposite corner, stepping only on light squares. If you can do it, the connection probably holds. If you hit a wall of painted squares with no way around, something is wrong.

A solving method that avoids guessing

Start with the smallest numbered rooms and work outward. Paint or mark every square that a numbered room forces. Then scan every row and column for corridor violations. If a straight line of light squares would cross three room borders, something in that line must be painted. Often the numbered rooms already limit which square it can be.

After the first pass, look for rooms whose numbers are now almost satisfied. A room that wants three painted squares and already has two means the remaining squares in that room are all light. Mark them and check what their corridors do.

If you are stuck, look for the connection rule. Ask yourself whether painting a particular square would cut the light region in two. If it would, that square must stay light. This negative information is just as useful as knowing what to paint. The game even helps you here: if two painted squares touch side by side, both are highlighted as errors, so you catch that mistake immediately.

Unnumbered rooms and what they mean

Not every room has a number. An unnumbered room can hold any number of painted squares, including zero. The generator starts with numbers on every room and then strips them away for as long as the puzzle remains unique. The rooms that keep their numbers are the ones that actually carry the core logic of the puzzle.

An unnumbered room is not a free space you can ignore. It still obeys the no-touching rule, the connection rule, and the corridor rule. You just do not know how many painted squares belong in it. That information has to come from the constraints imposed by the rooms around it.

Mistakes that lead to dead ends

  • Ignoring the corridor rule until the end. The corridor violations pile up and force you to unpaint squares you were sure about. Check corridors as you go.
  • Forgetting that diagonal contact is legal. Two painted squares touching at a corner is perfectly fine. Only side-by-side contact is forbidden.
  • Painting without marking. The light-mark tap is not decoration. It tracks which squares you have decided are unpainted, and without it the corridor rule is invisible.
  • Treating unnumbered rooms as empty. They still interact with the corridor rule and the connection rule. A long unnumbered corridor room might force one of its squares to be painted just to block a three-room run.
  • Trying to solve the whole grid at once. Work from the most constrained rooms outward. Small numbered rooms give you certainty. Spread that certainty outward one room at a time.

Every puzzle runs on your own device

The grid is generated and solved entirely in your browser. A full search proves that exactly one valid painting exists before the puzzle is shown to you, so guessing is never required and every grid is fair. Nothing is uploaded to any server and no account is needed. Your progress and move count live in this browser on this device and nowhere else. Once the page has loaded, you can go offline and keep solving.

Help

How to play Divided Rooms

A square takes three taps to get back where it started: dark, then pencilled in as staying light, then clear. Two dark squares may never sit side by side, and the light-square rule that catches people out is the straight run passing through three rooms, long after the counting is under control.

Read the room numbers

The number in the top left of a room is how many squares in that room end up painted. Rooms with no number can hold any amount.

Paint and mark

Tap once for a painted square and again for a light one. Marking the light squares is what makes the corridor rule visible.

Keep painted squares apart

Two painted squares may never touch side by side. They may touch at a corner.

Watch the long corridors

Follow any straight line of light squares. If it would enter a third room, something in it has to be painted.

Keep the light squares joined

Every light square must be reachable from every other by side steps. A painted wall that seals off a pocket is wrong.

Why the grids stop at seven squares across

A room layout is only kept once a full search has proved that exactly one painting satisfies all four rules — the numbers are removed afterwards, never before. Room size turns out to decide everything, and it fails in both directions: rooms of eight squares left three different answers standing even with every room numbered, while rooms of two or three left no legal painting at all, because a white run of three squares already touches three rooms nearly everywhere. Measured over twelve fresh grids, the five and six squares across came out with a single answer every time and the seven ten times out of twelve. An eight by eight managed it once in twenty and took five seconds a grid to fail, so it is not offered. On the rare grid that does slip through with two answers, either of them wins — the game checks the four rules rather than one stored answer.

Good to know

A room of two with a 1 in it

Small numbered rooms are where to start: a two-square room wanting one painted square immediately rules out both of its neighbours in one direction.

A room wanting zero is a free corridor

Nothing in it is painted, which usually pushes the corridor rule into the rooms either side.

The three-room rule needs a straight line

It only applies to a run in one direction. A light path that turns a corner can wander through as many rooms as it likes.

Corners are safe

Painted squares touching diagonally are perfectly legal. Only side-by-side is forbidden.

Common questions

Can painted squares touch at a corner?
Yes. Only side-by-side contact is forbidden.
What exactly does the third-room rule mean?
Take any unbroken straight run of unpainted squares. It may lie in one room or straddle two. It may never touch three.
Do rooms without numbers have a limit?
No. They still obey the other three rules but can hold any number of painted squares.
Is guessing ever needed?
No. Each grid is checked to have exactly one answer before it is shown.
What does the second tap do?
It marks a square as definitely light. That is for your own reasoning; the puzzle only cares which squares are painted.