WOLFRAM NOTEBOOK

Lights On/Lights Out Game and Solver

width
3
4
5
6
7
8
height
3
4
5
6
7
8
game
20
the game
all off solution
all on solution
Lights On/Lights Out is a puzzle game. Given a set of random lights, press one of the lights to toggle it and its four adjacent lights on and off. The objective of the game is to switch all the lights on or off. This Demonstration gives an instant solution to the puzzle.

Details

Suppose the puzzle has
M×N
squares. The solver sets up a system of
M×N
linear equations in
M×N
variables and uses the Mathematica built-in function Solve to find a solution. The solution page marks the squares that need to be pressed in red.
For more information, see the Wikipedia entry for Lights Out.

Permanent Citation

Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.