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]

Is there a way to prevent Nook from auto selling a spot in Animal Crossing? Is there a way to prevent Nook from auto selling a spot in Animal Crossing?

Posted On: May 28, 2023
My SO has that problem, but I never encountered it myself. It seems that Nook, when someone moves out, will auto fill the spot left with a random villager, and that in usually 2-3 days, sometimes e...[More]


Unsupported resolution in Mirrors Edge Unsupported resolution in Mirrors Edge

Posted On: January 24, 2023
I just installed the game, Mirror's Edge but unfortunately my LCD monitor isn't supporting its default resolution. My LCD monitor's resolution is 1024x768 60Hz. Question from user Te...[More]


How do you target a new player with a command on Minecraft 1.19.3? How do you target a new player with a command on Minecraft 1.19.3?

Posted On: January 16, 2023
I'm currently writing a datapack and want to have a message send only once to a player when they join the server for the first time.I have a rough idea of how I could use scores to say who isn't new, ...[More]


In Yakuza 0, Do weapon repairs cost less if a weapons durability isnt fully used up? In Yakuza 0, Do weapon repairs cost less if a weapons durability isnt fully used up?

Posted On: March 28, 2023
If I go to The Dragon & Tiger shop to repair a weapon or refill a gun's ammo, will it cost less money if I haven't fully used up all of that weapon's durability/ammo? Question from ...[More]


Whats the software used in Mega Man X speedruns? Whats the software used in Mega Man X speedruns?

Posted On: April 25, 2024
I'm starting out with my personal journey toward a 100% speedrun of Mega Man X, and I noticed that pretty much every speedrunner on YouTube is using a software that keeps track of time for each level:...[More]


Where can I find a Mercenary Guild envoy? Where can I find a Mercenary Guild envoy?

Posted On: April 22, 2024
I'm exploring the new space station's layout (after some recent updates), but I was only able to find a Merchants Guild envoy.Where are Mercenary Guild envoys located? I have a few pirate transponders...[More]


Are craftable traps a viable option? Are craftable traps a viable option?

Posted On: March 8, 2024
How viable of a weapon are the craftable traps for adventuring?The items I'm talking about:.Caltrops.Poisoned caltrops.Bear trap.Bleeding bear trap.Do they receive bonus damage from any of the basic d...[More]


How do I keep my animals from eating my people food in Rimworld? How do I keep my animals from eating my people food in Rimworld?

Posted On: May 22, 2023
I've got a reasonably flourishing village with decent population and all the amenities. However, lately I've been having severe issues because my tame animals keep breaking into the food wareh...[More]


How can I keep monsters out of my nether regions? How can I keep monsters out of my nether regions?

Posted On: January 24, 2017
In order to find myself some nice lapis lazuli and get away from my current base, I'm building a little tunnel in the Nether to allow me to get into the midst of some fresh chunks fairly quickly.I hav...[More]


How does Grabby Hand work in Peglin? How does Grabby Hand work in Peglin?

Posted On: August 24, 2023
The description for the Grabby Hand relic states:. Flying enemies are attacked horizontally, allowing for improved targeting. What does "attacked horizontally" mean? How does Grabby Ha...[More]