Problem 44766. Lights Out 12 - 5x5, three stages, <7 moves
Lights Out is a logic game wherein all lights need to be turned off to complete each board. See the first problem in the series for an introduction.
This problem is back to no wrapping and contains boards that each require six or fewer moves to solve. However, now lights are activated through three stages, rather than two, cycling from on1 (1) to on2 (2) to off (0). For example, if
board = [1 1 0 0 0 1 0 0 0 0 0 0 0 2 0 0 0 2 2 2 0 0 0 2 0];
the answer is:
moves = [1 1 19]
since the first "1" will change the 1's in (1,1), (1,2), and (2,1) to 2's. The second "1" will then change those three values to zero, while the "19" will bump the five 2's to zero. Therefore, up to two moves are possible for each button (index).
Prev.: 5x5, wrapping, any number of moves — Next: 5x5, 3 stages, x moves
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers9
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15378 Solvers
-
Project Euler: Problem 9, Pythagorean numbers
1083 Solvers
-
Find last zero for each column
494 Solvers
-
5215 Solvers
-
252 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!