Lights Out built with Flutter, 5x5 grid. Tap a light to toggle it and its orthogonal neighbors; turn every light off to win.
Not every possible on/off light pattern on a 5x5 board is actually solvable — Lights Out's reachable states are a proper subset of all 2^25 configurations. Generating a puzzle by lighting random cells directly can silently produce one that can't be solved.
This generator instead scrambles from the solved (all-off) board using the same toggle move the player uses. Since a toggle is its own inverse and toggles commute, replaying whatever sequence scrambled the board always undoes it — which proves every generated puzzle is solvable by construction, not by luck. Verified with a test that does exactly that: scrambles with a captured move sequence, then replays it and confirms the board returns to solved.
flutter pub get
flutter run
flutter test