Skip to main content

Heyawake Solver

Solve a Heyawake puzzle from its rooms and black-cell counts.

Heyawake, also called Birds in the Dark, is a shading puzzle on a board split into rooms. Paint some cells black so that a numbered room holds exactly that many black cells, black cells never touch edge to edge, every white cell stays connected, and no straight line of white cells runs through more than two rooms. Pick a size, click cells to group them into a room, set the room's black count, then solve.

Leave the black count blank for a room with no number. Click any of a room's cells again, or use Remove below, to undo it.

How it works

Heyawake asks you to paint cells black under four rules at once. A room with a number must contain exactly that many black cells, while a room with no number may hold any. No two black cells may share an edge. All of the white cells must form a single connected area. Finally, a straight horizontal or vertical line of white cells may not pass through more than two rooms, which is what keeps the white space broken up.

The solver fills the board one cell at a time. Because it works left to right and top to bottom, it can check the no-touch rule and the two-room white-line rule the instant a cell is painted, and it prunes any room that can no longer reach its count. Once the board is full it confirms the white cells are all connected. It also reports when a puzzle has more than one solution.