← back to CV $ ./lights_out --play

Lights Out · logic puzzle 💡

A logic puzzle: tapping a light also flips its neighbors. The goal is to turn them all on. Each level adds one more light. Pure JavaScript, with always-solvable level generation.

// concept seen on @joa5to · my own implementation

level 1 turns 0

Turn on all the lights.

the logic

Each light has two states: on / off. Tapping light i flips i-1, i and i+1.

It's a 1-D variant of the classic Lights Out. Levels are generated from the solved state by applying random moves, so they always have a solution.