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]

Multiclass for fighter? Multiclass for fighter?

Posted On: October 7, 2023
Im asking cuz im still in act 1 but since i learned about multi-classing, i was wondering on what is the best class and subclaas combo fo multiclass with fighter? Or if i should stay pure fighter ....[More]


How can you resist him? How can you resist him?

Posted On: October 23, 2025
Question from user Fun-Explanation7233 at BaldursGate3 at reddit.com.Answer:I havent done much with him, but when he drinks your blood I couldnt get him to stop so I died.But I loveed his reaction whe...[More]


Kagha arrange for Halsin's imprisonment? What was her plan? Kagha arrange for Halsin's imprisonment? What was her plan?

Posted On: December 29, 2024
[Spoilers].I figure she didn't, that she was already being seduced by the dark side of the Force, sorry wrong franchise, already being manipulated by the Shadow Druids, and when Halsin disappeared loo...[More]


lost my honour mode run in the most embarrassing way ever lost my honour mode run in the most embarrassing way ever

Posted On: January 17, 2025
So, here I am. .I have just defeated the emerald grove or whatever it's called and am now looting the empty goblin camp. It's really dark so I walk with a torch equipped in my hand and see some crate...[More]


Slay The Spire: Does defeating minions reward extra gold? Slay The Spire: Does defeating minions reward extra gold?

Posted On: January 15, 2024
When fighting an Elite Enemy, they can sometimes summon minions to assist them in the fight. Defeating the Elite causes any surviving minions to run away. Will defeating the minions before defeating t...[More]


What genre is A Plague Tale: Requiem? What genre is A Plague Tale: Requiem?

Posted On: July 10, 2023
I am not a competitive gamer; when I play, I play for fun, playing casually and solving the puzzle that is the game. I have played A Plague Tale: Innocence as well as A Plague Tale: Requiem for alm...[More]


What does shadow cache option exactly do in resident evil 4 remake? What does shadow cache option exactly do in resident evil 4 remake?

Posted On: April 10, 2023
Resident evil 4 remake on PC has the graphics option "shadow cache", what does it exactly do? The comparison picture they provide does not show any difference really. Is it dynamic or for mo...[More]


How can I give (or sell?) my dwarves mugs in dwarf fortress? How can I give (or sell?) my dwarves mugs in dwarf fortress?

Posted On: April 9, 2023
I've crafted two bins full of mugs, yet I still have dwarves having unhappy thoughts about drinking without mugs. Question from user aslum at gaming.stackexchange.com. Answer: You need an...[More]


Why cant I satisfy the Diamond Equipment challenge in Age of Empires 2? Why cant I satisfy the Diamond Equipment challenge in Age of Empires 2?

Posted On: June 30, 2023
I've tried to complete this challenge multiple times, but it never seems to complete. I have tried playing multiple single player skirmishes without cheats and completed all 15 blacksmith upgrades...[More]


Love the game but… do our decisions matter in Hogwarts Legacy? Love the game but… do our decisions matter in Hogwarts Legacy?

Posted On: March 22, 2023
Could we get a sim mode where our decisions actually effect the game play loop, things like a curfew system that matters and having to get to class on time have good rest a food and drink need be able...[More]