Tile Flip

Tap a tile and it flips, along with the four tiles touching it. Get the whole grid lit. It sounds trivial and it is a real logic puzzle, with a neat mathematical trick behind it.

Three grid sizes Always solvable No download
0
Taps
0
Lit
-
Best
Tap a tile to flip it and its four neighbours.

How to play

Tap any tile. That tile flips between on and off, and so do the four tiles directly above, below, left and right of it. Diagonals are unaffected. Your goal is to get every tile lit at the same time.

Every puzzle here is generated by starting from a fully lit grid and making random taps, so a solution always exists. If you are stuck, you have not been given an impossible board.

The two facts that make this solvable

Order does not matter

Tapping tile A then tile B produces exactly the same board as tapping B then A. Each tap is independent and simply toggles a fixed set of five squares. So you are not looking for a sequence, you are looking for a set of tiles to tap.

This simplifies the problem enormously and most players never notice it. You do not need to plan an order. You only need to work out which tiles need pressing.

Tapping the same tile twice does nothing

Two taps on the same tile flip its five squares twice, returning everything to where it started. So no tile ever needs to be tapped more than once, and any solution consists of each tile being tapped either zero times or once.

Put those two facts together and the consequence is striking. On a 4 by 4 grid there are 16 tiles, each either tapped or not, so there are only 2 to the power 16, which is 65,536 possible solution sets. That is a small enough space that the puzzle is genuinely finite rather than open ended.

The chase the lights method

This is the standard technique and it turns the whole puzzle into a mechanical procedure with only a little guessing at the start.

  1. Ignore the top row entirely. Do not tap in it.
  2. Work down. For every tile in the top row that is off, tap the tile directly beneath it. That fixes the top row permanently.
  3. Repeat. Now the second row is wrong in various places. For each unlit tile in row two, tap the tile beneath it in row three. Continue down the grid.
  4. Arrive at the bottom row. Every row above is now lit. If the bottom row is also lit, you have solved it.
  5. If not, the pattern remaining in the bottom row tells you which tiles in the top row you should have tapped at the start. There is a small lookup table for this. Tap those, chase down again, and it resolves.

That last step is the clever part. The bottom row acts as a readout of the mistake you made in your initial choice, which is why the method works without any search.

The mathematics, briefly

This puzzle is a system of linear equations over the field with two elements, where the only values are 0 and 1 and addition wraps around so 1 plus 1 is 0. Each tile is an equation stating whether it needs to change state, and each possible tap is a variable.

Solving it is Gaussian elimination, the same procedure used on ordinary simultaneous equations, done in arithmetic modulo 2. This is why order does not matter and why double taps cancel: both are properties of that arithmetic rather than features of the game.

It also explains a curiosity. On some grid sizes certain starting positions are unsolvable, because the underlying matrix is not invertible and some patterns fall outside the reachable set. The 5 by 5 case is the well known example. Generating puzzles by scrambling from a solved state avoids the problem entirely, which is what this version does.

The puzzle is generally known as Lights Out, after the handheld electronic game Tiger Electronics released in 1995, though the same mathematical structure had been studied before that.

Minimum taps

Because every solution set is unique in most cases, there is usually exactly one minimal answer, and the best score for a given board is a fixed number rather than something you can grind down. Your recorded best is per grid size, since a 5 by 5 puzzle needs considerably more taps than a 3 by 3.

Best scores are stored in your browser on your own device and never uploaded.

Common questions

Is every puzzle solvable?

Yes. Each board is created by starting from a fully lit grid and applying random taps, so reversing those taps always solves it. You will never be given an impossible position.

Does the order of my taps matter?

No, and this is the key insight. Each tap toggles a fixed set of five squares, so tapping A then B gives the same result as B then A. You are looking for a set of tiles to press, not a sequence.

What happens if I tap the same tile twice?

Nothing. The five squares flip twice and return to their original state. So no tile ever needs pressing more than once, and every solution consists of each tile pressed zero or one times.

What is the chase the lights method?

Work top to bottom. For each unlit tile in a row, tap the tile directly beneath it, which fixes the row above. Repeat down the grid. When you reach the bottom, the leftover pattern tells you which top row tiles you should have tapped first. Do those and chase again.

Why do diagonals not flip?

That is simply the rule of the puzzle, and it is what gives it the mathematical structure that makes it interesting. If diagonals flipped too, each tap would affect nine squares and the puzzle would behave quite differently.

Which grid size is hardest?

5 by 5, both because there are more tiles and because its underlying structure has a well known peculiarity, with some patterns unreachable from a random start. Scrambling from a solved position avoids that here.