Cody

Problem 44760. Lights Out 8 - 5x5, light-only solution? I

Solution 2177017

Submitted on 26 Mar 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
board = [0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0]; assert(lights_out_8(board)); % [2 4 6 10 16 20 22 24]

j = 2 4 6 10 16 20 22 24 board = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test1 (line 6) assert(lights_out_8(board)); % [2 4 6 10 16 20 22 24]

2   Fail
board = [1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1]; assert(lights_out_8(board)); % [1 5 7 9 17 19 21 25]

j = 1 5 7 9 17 19 21 25 board = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test2 (line 6) assert(lights_out_8(board)); % [1 5 7 9 17 19 21 25]

3   Fail
board = [0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0]; assert(lights_out_8(board)); % [2 6 8 12 14 18 20 24]

j = 2 6 8 12 14 18 20 24 board = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test3 (line 6) assert(lights_out_8(board)); % [2 6 8 12 14 18 20 24]

4   Fail
board = [1 1 0 1 1 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 1 1 0 1 1]; assert(lights_out_8(board)); % [1:2 4:7 9:10 16:17 19:22 24:25]

j = 1 2 4 5 6 7 9 10 16 17 19 20 21 22 24 25 board = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test4 (line 6) assert(lights_out_8(board)); % [1:2 4:7 9:10 16:17 19:22 24:25]

5   Fail
board = [0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0]; assert(lights_out_8(board)); % [3 7 9 11 13 15 17 19 23]

j = 3 7 9 11 13 15 17 19 23 board = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test5 (line 6) assert(lights_out_8(board)); % [3 7 9 11 13 15 17 19 23]

6   Fail
board = [1 0 1 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 1 0 1]; assert(lights_out_8(board)); % [1 3 5 11 13 15 21 23 25]

j = 1 3 5 11 13 15 21 23 25 board = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test6 (line 6) assert(lights_out_8(board)); % [1 3 5 11 13 15 21 23 25]

7   Fail
board = [0 1 1 1 0 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 0 1 1 1 0]; assert(lights_out_8(board)); % [2:4 6:7 9:11 13 15:17 19:20 22:24]

j = 2 3 4 6 7 9 10 11 13 15 16 17 19 20 22 23 24 board = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test7 (line 6) assert(lights_out_8(board)); % [2:4 6:7 9:11 13 15:17 19:20 22:24]

8   Fail
board = [0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0]; assert(~lights_out_8(board)); % [1 2 3 4 5 7 9 13]

j = 3 13 18 board = 0 0 0 0 0 1 0 1 1 0 0 0 1 1 1 1 0 1 1 0 0 0 0 0 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test8 (line 6) assert(~lights_out_8(board)); % [1 2 3 4 5 7 9 13]

9   Fail
board = [1 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0]; assert(~lights_out_8(board)); % [1 2 3 4 6 7 8 11 12 16]

j = 1 5 7 8 12 21 board = 0 0 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 0 0 1 0 0 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test9 (line 6) assert(~lights_out_8(board)); % [1 2 3 4 6 7 8 11 12 16]

10   Fail
board = [1 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 1 0 0 0 1]; assert(~lights_out_8(board)); % on your own

j = 1 5 8 12 13 14 18 21 25 board = 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test10 (line 6) assert(~lights_out_8(board)); % on your own

11   Fail
board = [0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 0 0 1 0 0 0 0 1 0 0]; assert(~lights_out_8(board));

j = 3 8 11 12 14 15 18 23 board = 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test11 (line 6) assert(~lights_out_8(board));

12   Fail
board = [1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1]; assert(~lights_out_8(board));

j = 1 2 4 5 6 10 16 20 21 22 24 25 board = 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test12 (line 6) assert(~lights_out_8(board));

13   Fail
board = [0 1 1 0 0 0 0 1 0 0 1 1 0 1 1 0 0 0 0 1 0 1 1 0 0]; assert(~lights_out_8(board));

j = 3 6 8 10 11 12 15 18 23 24 board = 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1 1

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test13 (line 6) assert(~lights_out_8(board));

14   Fail
board = [0 0 1 0 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 1 0 0]; assert(~lights_out_8(board));

j = 3 7 8 9 11 12 14 15 17 18 19 23 board = 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 0 0 1 0 0 0 0 1 0 0

Output argument "tf" (and maybe others) not assigned during call to "lights_out_8". Error in Test14 (line 6) assert(~lights_out_8(board));

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!