The rules to Nurikabe are actually quite simple, but they combine together to give some wonderful logic problems.
The challenge is to construct a maze (where the white squares are the walls), that satisfy these rules,
The walls are made of connected adjacent stone blocks.
The squares with numbers in them are part of a wall. That particular wall must contain exactly that
number of squares, e.g. A square with the number 4 in it means that it forms a wall with 3 other squares.
Walls may not touch each other, even if they have the same number (diagonally is fine).
All the squares that are not part of the wall make up the maze.
The maze must be one single connected whole, i.e. from any blue starting square, you must be able to
reach any other blue square by only moving to adjacent black squares. Diagonal moves are not allowed.
The maze can't contain any 2x2 'rooms'
From this set of rules, we can make a few deductions,
Once a wall has it's correct number of squares, all the squares around that wall must be blue.
As a special case of the first rule, if we see the number '1' in a square, then all the squares next to
that square must be blue. This is usually how we start a Nurikabe puzzle.
If we see two squares with numbers diagonally from each other as in this example:
then for those two walls to be seperated, the other two squares in this example must be blue.
If we see three blue squares forming an 'elbow' like this,
then we know the other square in this image must be white to avoid breaking rule 6.
All blue squares must be connected, so if there is an undecided square(s), and if the only way to
connect two seperate areas of blue squares is for the undecided square to blue, then that square must be blue.
All white squares eventually belong to a wall. So if we have an isolated white square, and there is only
way for it to connect to a wall, then those squares must be white.
You will sometimes find some undecided squares that cannot be reached from any island, or in doing so
would break another rule, then in that case, that square must be blue.
This is an example of a completed Nurikabe puzzle. You will see that the blue area is one completely
connected whole. Each of the white walls contains the correct number of blocks, and that none of them are
connected.
This is an example of a starting Nurikabe grid. There are three steps we will always take at the start of
a Nurikabe puzzle,
We normally have a series of clues containing 1 white wall, we can surround those with black
squares immediately.
We will also have some clues that are separated by just one unknown cell - I've highlighted
one example. We know that we can't have two white walls joined, so these must be black.
We will sometimes have two clues that are joined diagonally, there is an example in this
starting grid at the bottom. These two cells must be black to stop the two clues being part of the
same island.
A common technique is to look for cells where white islands can't reach. The highlighted top-right cell
is one such example - there isn't a white island that can reach this cell, hence this cell must be black.
We know that all of the black cells must be on single connected whole, i.e. we can't have any isolated
black cells that are 'cut-off' from the other black cells. This means that the four highlighted cells
must be black. If any of them were white, we would have one or more black cells cut-off from the
other black cells.
We have another three highlighted cells where there is now way for a white wall to reach those cells. We
can mark these cells as being black.
We can now start to look at the white islands. Firstly, look at the '2' clue on the right hand-side of
this puzzle. This wall can only expand upwards, i.e. into the highlighted cell.
We can also look at the '6' clue at the bottom of the puzzle. There is only way for this white wall
to expand, and that's in to the two highlighted cells.
After our last move we can see that the '2' clue on the right hand side of this puzzle has all of it's
wall cells. This means this block of white walls must now be surrounded by black cells, i.e. cell D
must be black.
We can now chain this type of reasoning together to fill a few cells in,
Cell A must be black, otherwise we would be isolating the black cell under it from the other
black cells.
This leaves our 6 white walls clue with only the option to expand upwards in to cell B.
This means that cell C must be black. If cell C was white, then this would leave the set of
black cells under it isolated from the rest of the black cells.
In the bottom-left of this puzzle is a wall with a '2' clue, so we know this wall will have two cells.
This wall can expand in to cell 'A', or cell 'B'. Either way, this means that cell 'C' must be black, so
we can fill this cell in.
Similarly with cells, 'D', 'E' and 'F'. The '2' clue must expand in to cells 'D' or 'E', which means
that cell 'F' must be black.
One of the Nurikabe rules is that we can't have a 2x2 block of black cells. If cell 'G' was black, then
this is exactly what we would have, therefore cell 'G' must be white.
We will now look in more detail at the '6' clue at the bottom of this puzzle. We already have 4 white
walls for this clue, so we need another 2. This wall can't expand in to cells 'C', 'D' or 'E' - two
walls aren't allowed to touch (diagonally is ok). Expanding in to any of these cells would give us two
touching white walls.
This means that our '6' clue can only expand in to cells 'A' and 'B'. We need another 2 cells, and this
is our only option.
This will leave us with our required number of white wall cells for the '6' clue, so we can surround
this block with black cells, i.e. cells 'C', 'D' and 'E' must be black.
There is now a range of cells we can look at,
If cell 'A' was white, then that would cut off the set of black cells to it's right, i.e. cell
'A' must be black.
Cell 'B' must be black to stop the cell under it being isolated.
There are two options for the '4' clue next to 'C', 'D' and 'E'. It can either expand in to 'C'
and 'D', or it can expand in to 'D' and 'E'. Either option has cell 'D' as a white wall, so we can
fill that in white.
There is now another range of cells we can look at,
The '2' clue at the bottom must expand in to cell 'A' - that wall has nowhere else to expand in
to.
This means that cell 'B' must be black.
This means that the '2' clue in the bottom-left corner must expand downwards in to cell 'C'.
The '2' clue next to cell 'D' must expand upwards, or to the left. Either possibility means that
cell 'D' must be black. This is the same technique we used a few moves above.
Cell 'E' must be white to stop us having a 2x2 block of black cells.
This means that the '4' clue now has all of it's white wall cells. This means that cell 'F'
must be black.
We can now look at this range of cells,
Cell 'A' must be black to stop the cell underneath being isolated.
The '3' clue must expand upwards in to cell 'B', i.e. cell 'B' must be white.
We can also look at cells 'D', 'E', and 'F' in the top-left. We know that at least one of these cells
must be white to stop us having a 2x2 block of black cells. The only way this can be achieved is if the
'5' clue expands upwards in to cells 'C' and 'D'. It might expand in to cells 'E' and 'F' as well, but
for the time being we can only fill cells 'C' and 'D' in white.
We can now look at the '5' clue in the middle-left of this puzzle. There is actually only one possibility
for this clue now - it can only expand in cells 'A', 'B', 'C' and 'D'. All other possibilities would mean
that this wall would merge with another wall section.
We can also fill in cells 'E', 'F', 'G' and 'H' in black to surround this white wall with black cells.
We can now look at this range of cells,
The '2' clue must expand upwards in to cell 'A'.
This means that cell 'B' must be black to surround the 2 white cells.
Cell 'C' must be black to stop the black cells below being isolated from the rest of the black cells.
We can now look at this list of cells,
Cell 'A' must be black to stop the large section of black cells below it being isolated from
the rest of the puzzle.
This means that the '3' clue can only expand in to cells 'B' and 'C', i.e. these cells
are white.
We shall now look at the labelled cells,
Cell 'A' must be black to stop the set of three cells below being isolated from the rest of
the grid.
This means the '5' clue can only expand in to cells 'B' and 'C', i.e. these cells must be black.
We can now finish this Nurikabe puzzle,
Cell 'A' must be black to stop the large set of black cells below being isolated from the
rest of the puzzle.
This means that '2' clue must expand upwards in to cell 'B'
The '2' clue now has it's full set of white cells, so cell 'C' must be black.
Finally, the '3' clue can only expand to the right in to cell 'D'.