Lights Out

**The goal is to make the board empty.**

When clicking on a field, the surrounding fields change in a certain symmetric pattern.

You can customize the size of the board and the click pattern in the Settings window, getting many different puzzles.

The **Solution** button calculates a possible solution, and shows red dots on the fields that must be clicked in order to clear the board. A few facts about the solution:

- The solution doesn't depend on the order of the clicks.
- No solution requires clicking on the same field multiple times.
- Not all patterns are solvable, but the program only generates solvable patterns.
- In certain configurations (e.g. 6x6, cross-shape), all possible patterns are solvable. In these cases, the solution is unique, up to the order of the clicks, and assuming that no field is clicked more than once.
- In those configurations where not all patterns are solvable, each solvable pattern has multiple solutions (with the same assumptions for uniqueness). The number of distinct solutions is always a power of two, and for a given configuration, it is the same for all solvable patterns. For example, for the default configuration (5x5, cross-shape), it is always four. This number can be queried by the Solution button. The chance for a random pattern to be solvable is 1/
*m*, where*m*is the number of solutions of a solvable pattern (but again, the program only generates solvable patterns). - For the default click pattern (cross-shape), the puzzle can be solved using a method called "light chasing": clear the board row by row from top to bottom, by clicking on the fields right below the "on" fields in the current row. Clearing the bottom row is more difficult: it must be learnt separately for each case (in the default 5x5 board, there are 8 cases for the last row), e.g. by using the Solution button. But it is enough to learn only the first row of the solution, because the rest can be done by repeating the light chasing, and now it is guaranteed that the last row will be empty.