# Corral

Corral Example

Corral is a puzzle type made by nikoli.

Cell types

All cells are either empty or containing a number. However, the edges of the cell can be blackened. To solve the puzzle, a valid loop that is formed by blackening some edges of some cells must be drawn.

Interaction

First, the loop must not cross itself…it may not even touch itself at any point.

Interpret the loop to be a continuous wall. From a cell, we can see on the four orthogonal directions. So R4C2 can see R3C2, R2C2, and R4C1. It can’t see either R4C3 or R4C4, since it’s blocked with the loop, and it can’t see R3C3, since the lines of sight are only orthogonal, not diagonal. A cell is called visible from another cell if this cell can be seen from that other cell.

A number in a cell tells how many cells are visible from that cell, the cell itself included.

Objective

Draw a loop such that each number correctly tells the number of cells visible from that cell, the cell itself included.

Walkthrough of the example

Note that all cells with numbers must be in the loop. First, note R1C1. If R1C2 is in the loop, then R1C1 will see R1C2 and R1C3 along with R1C1 itself, too many cells. So R1C2 is not in the loop, and thus the cell visible from R1C1 is R2C1 and R3C1 is not in the loop.

Since the cells must be connected (such that there exists a loop), R2C2 must be in the loop; otherwise, R1C1 and R2C1 are isolated. This causes R2C3 to be in the loop; otherwise the loop will cut itself.

Now, turn to the lower part. Assume R4C3 is in the loop. Then, R4C4 can only see R4C3 and R4C2, so R4C1 is not in the loop. By R4C2, R3C2 must be in the loop. But this also causes R2C2 to be visible, too many again. So R4C3 is not in the loop. By R4C4, R3C4 and R2C4 are in the loop and R1C4 isn’t. By R1C3, this means R3C3 is in the loop.

By R4C2, we can see that R4C1, R3C2, and R2C2 are in the loop. This completes the loop.