A cell is free if it is:
A white cell is visible from another white cell if:
The neighborhood of a cell is made of immediately adjacent cells, vertically and horizontally.
Case 1. If a cell X is free and there are no other free visible cells, then the cell X must contain a bulb.
Case 2. If a cell X is not illuminated, it contains a dot, there's only one free visible cell Y, then the free cell Y must contain a bulb.
Given a black cell ( ) C with a numeric constraint (nC), you need to count in its neighborhood ( ) the number of bulbs (bC) and the number of free cells (fC). The missing bulbs (mC) are the difference between the numeric constraint and the bulbs counted in the neighborhood (mC = nC - bC).
| C | |||
| • | |||
| 2 | |||
| • |
Given two black cells C and D, both with a numeric constraint, positioned close to each other in a diagonal direction, then you need to count the number of missing bulbs (mC, mD) and the number of free cells (fC, fD) in the neighborhoods of C and D, respectively. As in the case 5, it must be fC == mC + 1 (there's one more free cell than missing bulbs). Moreover the shared cells in the neighborhoods (adjacent to both C and D) ( ) must be free.
| D | |||
| C | |||
Case 6. mD == 1. There is only one missing bulb in the neighborhood of D. The two shared cells contain a bulb and a dot. Then you need to apply to C the same counting as in cases 3 and 4, but skipping the shared cells in both the neighborhoods of C and D and subtracting a bulb from the final result. This means you need to put mC - 1 bulbs (and then dots) in the remaining fC - 2 free cells in the neighborhood of C.
| 1 | |||
| 3 | |||
| 1 | |||
| ¤ | 3 | ||
| ¤ |
Case 7. mC == 1. The shared cells are the only two free cells in the neighborhood of C. The two free cells have to contain a bulb and a dot. Thus you need to apply to D the same counting as in cases 3 and 4, but skipping the shared cells in both the neighborhoods of C and D and subtracting a bulb from the final result. This means you need to put mD - 1 bulbs (and then dots) in the remaining fD - 2 free cells in the neighborhood of D.
| 1 | |||
| ¤ | 3 | ||
| ¤ |
| • | |||
| 1 | • | ||
| ¤ | 3 | ||
| ¤ |
Case 8. Given a free cell X, you try to put a bulb in it and then apply all obvious moves (cases 1-7). If the resulting configuration contains an error (violated constraints or bulbs illuminating each other), then the cell X must be marked with a dot.
Case 9. Given a free cell X, you try to mark it with a dot and then apply all obvious moves (cases 1-7). If the resulting configuration contains an error (violated constraints or bulbs illuminating each other), then the cell X must contain a bulb.
Case 10. Given a free cell X, you try to mark it with a dot and then apply all obvious moves (cases 1-7). In the same free cell X, you try to put a bulb and then apply all obvious moves (cases 1-7). If the two alternative resulting configurations are equals in certain cells, then those cells have an invariant content, which can be definitely applied to the game board.
If a cell Y, in both possible configurations of X, is marked with a dot or is illuminated (i.e. in both cases it cannot contain a bulb), then on the game board the cell Y must be definitely marked with a dot.
If a cell Y, in both possible configurations of X, contains a bulb, then on the game board the cell Y must definitely contain a bulb.