Cody

Solution 1993624

Submitted on 28 Oct 2019 by cokakola
  • Size: 31
  • This is the leading solution.
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   Pass
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]

count = 0

2   Pass
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]

count = 1

3   Pass
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]

count = 2

4   Pass
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]

count = 3

5   Pass
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]

count = 4

6   Pass
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]

count = 5

7   Pass
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]

count = 6

8   Pass
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]

count = 7

9   Pass
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]

count = 8

10   Pass
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

count = 9

11   Pass
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));

count = 10

12   Pass
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));

count = 11

13   Pass
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));

count = 12

14   Pass
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));

count = 13