Lights On/Lights Out Game and Solver

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram CDF Player or other Wolfram Language products.

Requires a Wolfram Notebook System

Edit on desktop, mobile and cloud with any Wolfram Language product.

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.

Contributed by: Xiangdong Wen (September 2009)
Open content licensed under CC BY-NC-SA


Snapshots


Details

Suppose the puzzle has squares. The solver sets up a system of linear equations in 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.



Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.
Send