Lights Out Puzzle
Pressing a cell toggles it and its specified neighbors. The cross rule uses orthogonal neighbors; the eight-neighbor rule also includes diagonals. Off-board positions are ignored. Seeded puzzles are made by real presses on an all-off board, so they have a solution. A manually edited board can be impossible; a GF(2) system distinguishes that case from a verified minimum-click plan.
Key features
- Exact edge-clipped toggles on 3×3, 4×4, and 5×5 boards with cross or eight-neighbor rules
- Reproducible solvable boards from a seed and scramble press count
- Edit individual lights to test even impossible configurations
- GF(2) elimination for consistency and bounded enumeration of all free-variable solutions for minimum clicks
- Hint, full press plan, arrow-key navigation, touch controls, undo, and reset
- Local JSON save and load with initial board, seed provenance, moves, and current board checked by replay
How to use
- Choose the board size, toggle rule, seed, and scramble press count, then create a puzzle.
- Press cells to toggle the selected cell and its neighbors. Use Tab and arrows to focus cells, Enter or Space to press, or tap on mobile.
- Check whether the current board is solvable, show or apply a hint, and optionally reveal the full press plan.
- In edit mode, tapping changes just one cell. Apply the pattern as a new game; edited patterns may be unsolvable.
- Undo the last press or reset to the initial pattern. Saved JSON is replayed and verified before it replaces your game.
Use cases
- Compare move sequences and minimum clicks for the same seeded puzzle
- Draw a lighting pattern and check whether the rule can clear it
- Explore how orthogonal and diagonal toggle rules change solutions
Frequently asked questions
Which lights change when I press a cell?
The cross rule toggles the pressed cell and its up, down, left, and right neighbors. The eight-neighbor rule adds all four diagonals. Edges and corners have fewer cells because off-board positions are ignored.
Are generated puzzles always solvable?
Yes. Generation applies seeded real presses to an all-off board, so repeating those presses clears it. This does not imply a uniform distribution of boards or difficulty.
Can a board I edit be unsolvable?
Yes. Editing changes one light without applying a legal press. If the GF(2) equations contain a contradictory row, the board is reported as unsolvable.
Is the shown press count really minimal?
For supported sizes and rules, the solver marks a minimum only when it has checked every free-variable solution under its enumeration cap. If that cap were exceeded, it would show a verified candidate without claiming minimality.
What do the hint and full plan mean?
The hint is the first cell in a verified set of presses that clears the current board. Toggle presses commute, so the plan's cells can be pressed in any order. No hint is invented for an unsolvable board.
Does this send my puzzle to a server?
No. The board, linear algebra, and JSON checks run in this browser tab. Files are downloaded or opened only when you request it.
Privacy
The board, seed, and move history stay in this browser tab. A local JSON file is written only when you request a save.
Comments & questions