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]

Can I bind a key to a macro without applying it on an action button? Can I bind a key to a macro without applying it on an action button?

Posted On: January 24, 2023
So far all I can do is to create a macro, place it on an action button, and make sure that this action bar has a key bound to it. But now I'm running out of action buttons.I would like to bind a key (...[More]


How can I perform an arbitrary search in the Xbox YouTube app? How can I perform an arbitrary search in the Xbox YouTube app?

Posted On: March 25, 2023
Admittedly I haven't played with the Xbox YouTube app much. I looked through various tabs and menus and could not find a way to perform a keyword search. Is there a way? Question from user EBon...[More]


How to perform a flat spin? How to perform a flat spin?

Posted On: April 1, 2024
In Asphalt Extreme, I am asked to perform a flat spin to achieve stars and stuff. What is this, and how do I pull such a move off?Question from user Mathias711 at gaming.stackexchange.com.Answer:A fla...[More]


Pokemon GO, What does this symbol mean in the Collector research? Pokemon GO, What does this symbol mean in the Collector research?

Posted On: May 1, 2023
In the temporary research there is a challenge to catch specific pokemon. Some are normal, some are event, but there is one that I'm not sure what it means. What does this symbol mean? Qu...[More]


Does being in full darkness prevent you from being detected in ToTK? Does being in full darkness prevent you from being detected in ToTK?

Posted On: May 16, 2023
* minor spoilers *. I'm trying to sneak my way underground early to try to find some goodies, and there's a lot. Fortunately it's not densely populated with enemies everywhere. Came acr...[More]


Does a bag carried out to the escape count as a secured bag? Does a bag carried out to the escape count as a secured bag?

Posted On: September 21, 2023
If I carry a bag out to the escape, rather than securing it in a helicopter or what have you (depending on the heist), does that bag count as a bag stolen at the end? Or do I need to throw the loot in...[More]


What's the worst way to re-class every companion? What's the worst way to re-class every companion?

Posted On: October 16, 2025
Everyone talks about the best way. .What would be the worst and/or most unhinged classes to give each companion. .My favorite would be making Minthara a Wizard.Question from user kikicandraw at Baldur...[More]


How can two squads of COD friends join the same DMZ instance? How can two squads of COD friends join the same DMZ instance?

Posted On: May 9, 2023
In the Call of Duty DMZ mode, you are in squads of 3 players, however it's possible to create an alliance when in game by inviting other squads to join you. You can invite a squad using the pin...[More]


Is it dangerous to go extreme pig riding in a thunderstorm? Is it dangerous to go extreme pig riding in a thunderstorm?

Posted On: January 6, 2015
I like to saddle up my piggy for a ride into thunderstorms. But what happens to my piggy if we get hit by lightning? Question from user Sadly Not at gaming.stackexchange.com. Answer: If a pig...[More]


What is the name of this shader pack? What is the name of this shader pack?

Posted On: March 22, 2024
I have always seen this shader pack throughout the internet, but I could never find any info about what it was called. (The main differences are the clouds and the water reflections.).Screenshot.Quest...[More]