# Nurikabe Rules

### A brief guide

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,
2. 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.
3. Walls may not touch each other, even if they have the same number (diagonally is fine).
4. All the squares that are not part of the wall make up the maze.
5. 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.
6. 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. Every puzzle will contain a limited number of walls that are only one block in size. The first thing we will do is surround those 1-block walls with blue blocks.
In this puzzle we also have two walls that are only separated diagonally (the two that have a '5' in them), so we will place blue blocks between them to separate them.
We can now decide on those cells with a red cross in them. If the highlighted square in the top left was a wall, then it would block off the blue block above it, which would be against the rule 5. So, this cell must be blue.
Looking at the two cells in the bottom left, they also can't be walls as there isn't a wall starting block that can reach them. If a particular cell is to be a wall, then it must be close enough to a wall starting cell that it can be reached. The '2' between the two highlighted cell can't reach either of the highlighted cells.
We can now decide on all of the highlighted cells.
• The wall with 4 blocks must expand in to the highlighted cells as there is nowhere else for it to expand in to. We can also surround this wall with blue blocks.
• The cell on the left handside must be blue, as there isn't a wall that can reach it. The wall with 7 cells is long enough to reach it, but in doing so it wouldn't give the '3' enough space to expand in to.
• The cell at the bottom must be a wall, otherwise you would have a 2x2 block of blue cells, which is against rule 6.
• The remaining highlighted cell on the right must be blue, as there is no wall that can reach it.
We have made great progress in solving this puzzle. The rest of the puzzle can be solved using the same techniques.
The single white cell has been highlighted as a mistake as it isn't currently connected to any other wall - this will be removed once it is connected to another wall.