Yajilin (adapted from Nikoli)
- Draw a line to make a single loop.
- Lines pass through the centers of cells, horizontally, vertically, or turning. The loop never crosses itself, branches off, or goes through the same cell twice.
- The numbers with arrow show how many black cells there are in the direction of the arrow.
- The number 0 without arrow denotes nothing (it can be treated as a "white wall").
- The loop does not pass through the black cells or the cells with numbers, and black cells cannot touch horizontally or vertically. The loop has to pass through all of the other (white) cells.
- Some parts of the loop are already given by the blue lines.
Answer
Second puzzle
There are many cells on the border which can't be walls because that would create a dead-end cell next to them (i.e. an empty cell with only one open side). Mark those as empty.
There can't be a wall-empty-wall sequence on the border, because the middle cell would be a dead end. That solves the 2s at the top and along the right-hand border.
Fill in the line in empty cells which have only two open sides.
The bottom 2 is trivially solved now.
This cell cannot be empty, because in that case the only way to fill the 2 to the right of it would make a dead end in between.
So it has to be a wall.
Some more cells that can't be walls because they would create a dead end.
So all those have to be empty.
Now, the 2 near the top-right corner has three possibilities for wall cells. The adjacent cells can't both be walls, so this cell has to be a wall.
Regardless of how the 2 is filled, neither of the cells marked pink can be a wall or there'd be either two adjacent walls or a dead end somewhere.
So mark those cells empty.
Now, there is no way to put three walls in four adjacent cells, so the cell directly next to the 3 must be a wall.
Only one way to fill this 2 now.
Having the two cells marked pink be walls would make a dead end. So the only legal way to complete the 3 is if the circled cell is a wall.
Marking that cell a wall solves the entire bottom-left corner. Fill in the loop.
There's a dead-end cell on row 3, column 2. That has to be a wall, and marking it a wall allows resolving the loop even further.
Neither of these cells can be a wall. Making the topmost one a wall would create a dead end, and making the bottom-most one a wall would create a closed loop. Also, there needs to be a line between these cells to prevent a closed loop.
The loop can't continue this way, because we'd force a closed loop near the top-left corner.
So it must continue upwards. This solves the entire left part of the grid.
We need to get both ends of the loop out of the bottom-right corner, so none of these cells can be walls. In fact, we can already fill in how the ends of the loop come out since there are only two spaces where they can go.
Like so.
Both of the pink cells cannot be walls, because that would force a dead end. So the circled cell must be a wall to satisfy the 2 below.
This solves the entire bottom-right corner.
This cell would be a dead end, so it has to be a wall.
Now, the same story with this cell. This solves the rest of the grid.
Final solution.
No comments:
Post a Comment