LightsOut
README
Lights Out
About
Lights Out is an electronic puzzle game released by Tiger Electronics in 1995. The game starts with an N x N grid, usually 5x5, of lights in a randomly configured state: on or off. The goal is to turn off all the lights by pressing a sequence of lights that will toggle its direct neighbors. Interestingly, the board can be represented as a matrix, and with the help of some linear algebra we can solve directly for a solution to a given configuration. For those interested, a short explanation of the mathematics behind the solver can be found here.
The program simulates the game by creating a random, valid configuration. Additionally, there is a "solver" button that steps through the most efficient solution as well as a "new" button which refreshes the board with a new configuration.
Built With
Demo

Getting Started
Prerequisites
This project was built with Python version 3.14.3. Please ensure that you use at least Python 3.14 for the program to be fully functional. Earlier versions have not been tested and are not guaranteed to work.
- Python/pipsh
py -m pip install --upgrade pip
Installation
- Clone the reposh
git clone https://github.com/Implycitt/LightsOut.git cd LightsOut - Create a venv sh
python3 -m venv .venv source .venv/bin/activate - Install the packages
pip install -r requirements.txt - run the main .py filesh
python src/main.py
Resources
- Physics for the birds - original video inspiration
- MAA
- Madsen Lights Out
- Wolfram Alpha Lights Out
- Rebecca S. Meyer's The Game Of Lights Out
License
Distributed under the MIT license. See LICENSE.txt for more information.