Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Properties of Lights Out: The Game (imois.in)
98 points by duck on Nov 30, 2023 | hide | past | favorite | 14 comments


I had an iPod back when iPods were slowly not becoming a thing anymore running Rockbox, which has a 4x5 Lights Out called FlipIt which I’d play between or during university lectures:

https://download.rockbox.org/daily/manual/rockbox-fiiom3k/ro...

With a bit of work I discovered that the 4x5 version could be solved mentally, although perhaps not in minimal moves, but definitely without pushing the same button twice. Here's how I thought through it:

Define R-propagation as the process of pressing in the 2nd column to turn off the lights in the 1st column, pressing in the 3rd column to turn off the lights in the 2nd column, and so on until the only lights on are in the 5th column. Then define L-propagation as the mirror image process. I was very surprised to find that for 4x5, R-prop followed by L-prop solves the Lights Out; L-prop of these two cases is (stopping before the last step otherwise it's boring),

    . . . . o       o . . . .
    . . . . .  -->  . o . . .
    . . . . .       o o . . .
    . . . . .       . o . . .
 
    . . . . .       . o . . .
    . . . . o  -->  . o . . .
    . . . . .       . . . . .
    . . . . .       o o . . .
This means that all you have to do to mentally solve 4x5 is to figure out, “if I did R-prop, what buttons would I end up pressing in the 5th column,” press those buttons first, and then L-prop will solve the rest.

Fun times!


The source for the Flip game in Simon Tatham's Portable Puzzle Collection is available: https://git.tartarus.org/?p=simon/puzzles.git;a=blob;f=flip....

It’s fairly well commented C code, but I admit that I don’t fully understand how the game generation or solver work. It’s definitely an interesting game!


Simon Tatham's Puzzles (free, zero ads) mobile app: https://apps.apple.com/us/app/simon-tathams-puzzles/id622220...

Also on other platforms.

A dangerous time-sink. Take care if you love puzzle games but don't have much free time! Especially when you start to use the custom puzzle sizes for more challenging games!


Nooo! There goes my Friday productivity..


> This matrix M is a kind of strange 'thick' diagonal matrix.

Maybe it's too obvious to mention, but M is just the adjacency matrix of the board (with self-loops).


This was one of the first games I was inspired to implement when I was getting into programming, around 15 years ago. My version was "Liights Out!"[0], a homebrew game for the Wii which used the devKitPro toolchain.

The inspiration actually came from Steve Troughton-Smith's "Lights Off"[1], of the very early days of iPhoneOS app development. His version looked a lot nicer :)

[0] https://www.gamebrew.org/wiki/Liights_Out!_Wii

[1] https://mastodon.social/@stroughtonsmith/110714267275454560


It would be nice to redraw the 4096x4096 graphic using only 512x512 big "pixels" that contain the information of 8x8 points, so the bad points are more visible. Perhaps in each 8x8 "pixel" take the average of the 64 poins, or take the maximum (I don't know which version would create more nice graphics, probably the maximum, because interesting poinst are very sparse.)


now try when the buttons don't all do the same thing

https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/flip...


(Probably obvious, but the exact same reduction to a system of linear equations can solve this.)


Ye gods


It took me way too long to realize that lights are actually blue (it is stated in the beginning, but I skipped it because intuitively the lighta should be, well, lighter).


There was a palm pilot version of Lights Out that I used to play a lot when I had my Tungsten E. At the time I felt like I was pretty good at solving it, but now I've completely forgotten the strategy.


I wrote the palm pre version that was available at launch. I had 86k downloads on launch day while watching district 9. I didn't think of or know how to do mobile ads, and apparently missed out on a very nice payday according to the other launch app (poker/blackjack). I did write the app while at a bar so whatever.


I remember finding patterns to "collapse" into fewer points, like closing a flower back up by booping it in the middle. And then after I'd collapsed all I could, cascading as described in the article. Rarely did I need to run another round of collapse after a cascade.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: