Live data from Hacker News

Show HN: Lights Out: my 2D Rubik's Cube-like Game

raymondtana.github.io

11–20 of 28 posts

Re: Show HN: Lights Out: my 2D Rubik's Cube-like Game

#11

Memorize which cells are white when the board first loads. Tap all of those in order without regard to the way the board changes as you go. Edit: above tested for 5x5 rows&cols. For even boards it seems there’s a small end-game to repeat the process — something about parity I assume.

Why does that work?

Re: Show HN: Lights Out: my 2D Rubik's Cube-like Game

#12

Memorize which cells are white when the board first loads. Tap all of those in order without regard to the way the board changes as you go. Edit: above tested for 5x5 rows&cols. For even boards it seems there’s a small end-game to repeat the process — something about parity I assume.

Why does that work?

If you think of each button press as a matrix being added to the board state where only the row and column are set to 1, along with the commutative nature of the moves (order doesn't matter), then as long as the total number of "flips" from the cumulative matrices of moves is odd, then it will reset the board.

Mathematically I might say that the system's precomputed solution vector is readily apparent.

Re: Show HN: Lights Out: my 2D Rubik's Cube-like Game

#13

Earlier quoted context omitted.

Why does that work?

If you think of each button press as a matrix being added to the board state where only the row and column are set to 1, along with the commutative nature of the moves (order doesn't matter), then as long as the total number of "flips" from the cumulative matrices of moves is odd, then it will reset the board. Mathematically I might say that the system's precomputed solution vector is readily apparent.

What if there was only one white block on the grid?

Re: Show HN: Lights Out: my 2D Rubik's Cube-like Game

#14

Earlier quoted context omitted.

If you think of each button press as a matrix being added to the board state where only the row and column are set to 1, along with the commutative nature of the moves (order doesn't matter), then as long as the total number of "flips" from the cumulative matrices of moves is odd, then it will reset the board. Mathematically I might say that the system's precomputed solution vector is readily apparent.

What if there was only one white block on the grid?

The game is initialized with a guaranteed solvable board:

https://github.com/RaymondTana/Lights_Out/blob/31fe5e866c45c...

Re: Show HN: Lights Out: my 2D Rubik's Cube-like Game

#17

Earlier quoted context omitted.

If you think of each button press as a matrix being added to the board state where only the row and column are set to 1, along with the commutative nature of the moves (order doesn't matter), then as long as the total number of "flips" from the cumulative matrices of moves is odd, then it will reset the board. Mathematically I might say that the system's precomputed solution vector is readily apparent.

What if there was only one white block on the grid?

I’m pretty sure this case is solvable too. Click the white block, then click all the blocks which turned white after that. This flips each block twice (bringing them back to their original state), except for the original white block which was only flipped once.

Re: Show HN: Lights Out: my 2D Rubik's Cube-like Game

#18
A straightforward solution for larger puzzles: if you click on the four corners of a rectangle, you flip those corners while leaving the rest of the rows/columns the way they started. So after you pick the low hanging fruit at the start, find any rectangle with 3 or 4 white corners, and then click on all 4 corners of that rectangle. If this leaves you with a just one white in each row and column, it's easy and doesn't require memorization to click each of those whites to get to the solved state.

Re: Show HN: Lights Out: my 2D Rubik's Cube-like Game

#20
post #16

Not to be confused with the other grid based light flipping game, Lights Out, from 1995. https://en.wikipedia.org/wiki/Lights_Out_(game) Math article https://matroidunion.org/?p=2160

Or 80s Merlin’s Magic square game.

https://en.wikipedia.org/wiki/Merlin_(console)

Which was only 3x3. But red LEDs which were all the rage in handhelds in the 80s.

When learning JavaScript I made a dupe of the Merlin game in JavaScript. It’s really old but still seems to run. Lacks the depth of this game with its larger grid.

https://www.aramcomjean.com/magic_squares.html

Post reply on HN