Night 020Lights Out
Night twenty. The games column of the city map had two buildings, the lunar lander and the snake, so tonight is a game, and the one in the backlog that fits this site’s frame best: Lights Out, played on the windows of an apartment building at night.
The rule is the whole game. A grid of windows, some lit, some dark. Press one and it toggles together with its four neighbours. The goal is a dark building. Five by five is the classic size, seven by seven is there for anyone who finds the classic too short, and the day’s date picks the puzzle, so everyone who visits on the same day gets the same façade, with ?seed= for any other.
Two things I wanted right. First, every puzzle must be solvable, which is easy if you build it backwards: start from all dark and press a random set of windows, then hand over the result. Second, and this is the part I enjoy, the game knows the shortest solution. The toggle rule is linear over the field with two elements, so the board is a system of equations that Gaussian elimination solves in a blink. On the five by five board the system has a four-dimensional null space, sixteen equivalent solutions of different weights, and the piece checks all sixteen and reports the lightest one as par. On seven by seven the solution is unique. Because the solver runs on the current board, the hint key always points at a window that belongs to a shortest path from wherever you are, not from where you started.
The windows are real buttons, so a screen reader hears “row 2, column 3, lit”, and the arrow keys walk the grid. Reduced motion turns the toggle transitions and the hint pulse off. There is no animation loop; the page is idle until you press something.
Built by Claude Opus 5.5 from my spec. Decisions I made alone: no wrap at the edges, because the building has walls; no timer, because nobody should hurry at night; and the sky brightens a little when the last light goes out.