Strategy for solving Lights Out puzzle

[BACK]
Strategy for solving Lights Out puzzle
Posted On: August 26, 2023

Lights Out is a grid-based puzzle where each cell has two states: on/off. You can swap the state of any cell, but when you do so, the adjacent cells (horizontally or vertically) are swapped as well. Given initial the grid with random states, the objective is to set all cells to off state.


However, I've never been able to develop a strategy of how to solve (by hand) this type of puzzle. Usually I end up switching cells at random. What kinds of strategy are available for solving this game?


There are many variations of this puzzle, but I'm only interested in the classic one.


This puzzle is available in many grid sizes. It's desirable, but not required, that the proposed strategies work on all grid sizes.


My usual (and flawed) strategy is trying to clear row after row, from the top to the bottom. Unfortunately, I end up unable to clear the last row, and then I just start swapping cells at random, or just ragequit altogether.


There is an open-source and multi-platform implementation called flip as part of Simon Tatham's Portable Puzzle Collection.


Question from user Denilson Sá Maia at stackexchange.


Answer:

The method I'm about to explain technically works for any size grid, but it requires some knowledge that I don't know how to determine from scratch. If you want to do some searching online related to it, the method is generally referred to as "chasing lights" or "chasing the lights".


Start by pushing the buttons on the second row corresponding to the lit cells on the top row, then the buttons on the third row corresponding to the lit cells in the second row, etc. This is exactly what you were already doing, chasing the lights down to the bottom row, which is where the name comes from. .


Now, as you know, the tricky part comes when you've got a grid that's blank except for the bottom row. At this point, the way to finalize it is to push some specific buttons on the first row corresponding to the lit cells on the bottom row, and then chase the lights down from the top again. If you pushed the right first-row buttons, when you complete the second chase, the puzzle will be solved.


As far as I know, you have to just know which buttons to push on the top row to correspond to a specific pattern that was left on the bottom row after the initial chase. If you can figure out a method of determining the right ones to push on the top, you can probably use a very similar method to generalize this to any size grid. I don't know a method for this though, so I'll, uh, leave that as an exercise to the reader.


For the classic 5x5 version of the puzzle, it turns out that there are only 7 possible patterns on the bottom row after the initial chase down, so I'm just going to list the 7 possible patterns and the corresponding first-row buttons to press for each. Buttons are numbered from left to right.


Answer from user Chad Birch at stackexchange.



[BACK]
Strategy for solving Lights Out puzzle
Posted On: August 26, 2023

Lights Out is a grid-based puzzle where each cell has two states: on/off. You can swap the state of any cell, but when you do so, the adjacent cells (horizontally or vertically) are swapped as well. Given initial the grid with random states, the objective is to set all cells to off state.


However, I've never been able to develop a strategy of how to solve (by hand) this type of puzzle. Usually I end up switching cells at random. What kinds of strategy are available for solving this game?


There are many variations of this puzzle, but I'm only interested in the classic one.


This puzzle is available in many grid sizes. It's desirable, but not required, that the proposed strategies work on all grid sizes.


My usual (and flawed) strategy is trying to clear row after row, from the top to the bottom. Unfortunately, I end up unable to clear the last row, and then I just start swapping cells at random, or just ragequit altogether.


There is an open-source and multi-platform implementation called flip as part of Simon Tatham's Portable Puzzle Collection.


Question from user Denilson Sá Maia at stackexchange.


Answer:

The method I'm about to explain technically works for any size grid, but it requires some knowledge that I don't know how to determine from scratch. If you want to do some searching online related to it, the method is generally referred to as "chasing lights" or "chasing the lights".


Start by pushing the buttons on the second row corresponding to the lit cells on the top row, then the buttons on the third row corresponding to the lit cells in the second row, etc. This is exactly what you were already doing, chasing the lights down to the bottom row, which is where the name comes from. .


Now, as you know, the tricky part comes when you've got a grid that's blank except for the bottom row. At this point, the way to finalize it is to push some specific buttons on the first row corresponding to the lit cells on the bottom row, and then chase the lights down from the top again. If you pushed the right first-row buttons, when you complete the second chase, the puzzle will be solved.


As far as I know, you have to just know which buttons to push on the top row to correspond to a specific pattern that was left on the bottom row after the initial chase. If you can figure out a method of determining the right ones to push on the top, you can probably use a very similar method to generalize this to any size grid. I don't know a method for this though, so I'll, uh, leave that as an exercise to the reader.


For the classic 5x5 version of the puzzle, it turns out that there are only 7 possible patterns on the bottom row after the initial chase down, so I'm just going to list the 7 possible patterns and the corresponding first-row buttons to press for each. Buttons are numbered from left to right.


Answer from user Chad Birch at stackexchange.



[BACK]

Redstone door lock (memory cell) Redstone door lock (memory cell)

Posted On: March 30, 2024
I want to make a pvp map which has 2 spawnpoints on the map. The spawnpoints are closed off with an iron door. The teams can both get ready by flipping a lever. Now i want to make it so when both team...[More]


What does a checkmark in the Monster List mean? What does a checkmark in the Monster List mean?

Posted On: November 27, 2023
When looking at the Monster List, what does it mean when a monster has a green checkmark next to them? Question from user Stevoisiak at stackexchange. Answer: A green checkmark means you have...[More]


How do restaurants and markets differ in their functions and benefits in Tropico? How do restaurants and markets differ in their functions and benefits in Tropico?

Posted On: May 30, 2023
It seems that both the restaurant and the market are used by Tropicans to satisfy their "food" needs. Since the restaurant has the added convenience of also satisfying the "entertainmen...[More]


Can I get Dishonored to stop asking for admin access whenever I run it? Can I get Dishonored to stop asking for admin access whenever I run it?

Posted On: February 6, 2023
Every time I run Dishonored under Steam I get a pop up asking me for my Administrator password (I run as a normal user account, I imagine a UAC prompt would come up if I was running as Admin). I think...[More]


Unable to give player custom splash potion Unable to give player custom splash potion

Posted On: April 26, 2024
I'm trying to make a custom splash potion but whenever I give it to myself it gives me a splash uncraftable potion.What am I doing wrong?The command I'm using is:./give @p minecraft:splash_potion{tag:...[More]


How to execute a specific item in minecraft How to execute a specific item in minecraft

Posted On: April 26, 2024
I want to make a command executing a tripwire hook when it is thrown in the ground you summon a lighting bolt but it seems you can't add NBT tags in an execute command so how to specify the item I wan...[More]


On the scale of 1 to 10. How freaked out are you? On the scale of 1 to 10. How freaked out are you?

Posted On: July 30, 2025
10 pretty freaked out.Question from user Josh_thebosh109 at BaldursGate3 at reddit.com.Answer:If Im banging away and the chosen of the dead three plus temu-Geralt barge in and start watching? Pretty d...[More]


Why is the fishing rod so helpful for PvP in old combat? Why is the fishing rod so helpful for PvP in old combat?

Posted On: September 26, 2023
I have always played PvP on servers like Hypixel, and for years I've noticed that I always get a fishing rod when I duel other players. I have used it, but I have never seen a difference when I ac...[More]


How do I beat level 31 in Worms 2 Armageddon? How do I beat level 31 in Worms 2 Armageddon?

Posted On: August 7, 2023
As a lifelong gamer, I was amazed by the difficulty of Worms 2: Armageddon on the Android platform. After a long struggle, I was finally able to finish level 30, which is basically the end of the camp...[More]


In Hogwarts, Am I Wendelin the weird? In Hogwarts, Am I Wendelin the weird?

Posted On: June 11, 2023
Is it werid to have too many profiles because well…er…I have 20 profiles just for my own characters each with their own unique backstory am just asking do you think it’s weird to h...[More]