Cody

# Problem 44769. Lights Out 14 - 5x5, four stages, x moves

Solution 2068619

Submitted on 24 Dec 2019
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 = [1 1 0 0 3 1 0 0 3 3 0 0 0 0 3 0 0 2 0 0 0 2 2 2 0]; moves = lights_out_14(board); % [1 1 1 15 15 22] b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 2 2 2 moves = 2 2 2 7 7 7 moves = 2 2 2 7 7 7 22 moves = 2 2 2 7 7 7 22 3 moves = 2 2 2 7 7 7 22 3 8 8 moves = 2 2 2 7 7 7 22 3 8 8 13 moves = 2 2 2 7 7 7 22 3 8 8 13 4 4 moves = 2 2 2 7 7 7 22 3 8 8 13 4 4 9 moves = 2 2 2 7 7 7 22 3 8 8 13 4 4 9 14 moves = 2 2 2 7 7 7 22 3 8 8 13 4 4 9 14 19 19 19 moves = 2 2 2 7 7 7 22 3 8 8 13 4 4 9 14 19 19 19 10 10 moves = 2 2 2 7 7 7 22 3 8 8 13 4 4 9 14 19 19 19 10 10 25 moves = 1 1 2 2 2 3 4 4 6 6 7 7 7 8 8 9 10 10 13 14 19 19 19 22 25 12 12 moves = 1 1 2 2 2 3 4 4 6 6 7 7 7 8 8 9 10 10 13 14 19 19 19 22 25 12 12 3 3 moves = Columns 1 through 30 1 1 2 2 2 3 4 4 6 6 7 7 7 8 8 9 10 10 13 14 19 19 19 22 25 12 12 3 3 13 Column 31 13 moves = Columns 1 through 30 1 1 2 2 2 3 4 4 6 6 7 7 7 8 8 9 10 10 13 14 19 19 19 22 25 12 12 3 3 13 Columns 31 through 33 13 18 18 moves = Columns 1 through 30 1 1 2 2 2 3 4 4 6 6 7 7 7 8 8 9 10 10 13 14 19 19 19 22 25 12 12 3 3 13 Columns 31 through 35 13 18 18 4 4 moves = Columns 1 through 30 1 1 2 2 2 3 4 4 6 6 7 7 7 8 8 9 10 10 13 14 19 19 19 22 25 12 12 3 3 13 Columns 31 through 37 13 18 18 4 4 14 14 moves = Columns 1 through 30 1 1 2 2 2 3 4 4 6 6 7 7 7 8 8 9 10 10 13 14 19 19 19 22 25 12 12 3 3 13 Columns 31 through 39 13 18 18 4 4 14 14 24 24 moves = Columns 1 through 30 1 1 2 2 2 3 4 4 6 6 7 7 7 8 8 9 10 10 13 14 19 19 19 22 25 12 12 3 3 13 Columns 31 through 41 13 18 18 4 4 14 14 24 24 20 20 moves = Columns 1 through 30 1 1 2 2 2 3 4 4 6 6 7 7 7 8 8 9 10 10 13 14 19 19 19 22 25 12 12 3 3 13 Columns 31 through 43 13 18 18 4 4 14 14 24 24 20 20 25 25

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test1 (line 6) moves = lights_out_14(board); % [1 1 1 15 15 22]

2   Fail
board = [0 3 2 0 0 3 1 2 0 0 3 1 2 0 0 3 1 2 0 0 0 3 2 0 0]; moves = lights_out_14(board); % [1:10 6:10] b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 7 moves = 7 12 12 moves = 7 12 12 13 13 13 moves = 7 12 12 13 13 13 18 18 moves = 7 12 12 13 13 13 18 18 4 moves = 7 12 12 13 13 13 18 18 4 9 9 9 moves = 7 12 12 13 13 13 18 18 4 9 9 9 14 14 14 moves = 7 12 12 13 13 13 18 18 4 9 9 9 14 14 14 19 19 19 moves = 7 12 12 13 13 13 18 18 4 9 9 9 14 14 14 19 19 19 24 24 moves = 7 12 12 13 13 13 18 18 4 9 9 9 14 14 14 19 19 19 24 24 5 moves = 7 12 12 13 13 13 18 18 4 9 9 9 14 14 14 19 19 19 24 24 5 15 15 moves = 7 12 12 13 13 13 18 18 4 9 9 9 14 14 14 19 19 19 24 24 5 15 15 20 20 moves = 7 12 12 13 13 13 18 18 4 9 9 9 14 14 14 19 19 19 24 24 5 15 15 20 20 25 25 25 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 36 25 25 25 2 2 2 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 39 25 25 25 2 2 2 7 7 7 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 40 25 25 25 2 2 2 7 7 7 12 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 42 25 25 25 2 2 2 7 7 7 12 8 8 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 45 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 48 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 4 4 4 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 51 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 4 4 4 9 9 9 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 53 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 4 4 4 9 9 9 14 14 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 54 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 4 4 4 9 9 9 14 14 19 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 55 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 4 4 4 9 9 9 14 14 19 24 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 57 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 4 4 4 9 9 9 14 14 19 24 5 5 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 59 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 4 4 4 9 9 9 14 14 19 24 5 5 10 10 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 60 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 4 4 4 9 9 9 14 14 19 24 5 5 10 10 15 Column 61 15 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 60 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 4 4 4 9 9 9 14 14 19 24 5 5 10 10 15 Columns 61 through 62 15 20 moves = Columns 1 through 30 1 1 4 5 6 6 6 7 9 9 9 12 12 13 13 13 14 14 14 15 15 18 18 19 19 19 20 20 24 24 Columns 31 through 60 25 25 25 2 2 2 7 7 7 12 8 8 18 18 18 4 4 4 9 9 9 14 14 19 24 5 5 10 10 15 Columns 61 through 64 15 20 25 25

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test2 (line 6) moves = lights_out_14(board); % [1:10 6:10]

3   Fail
board = [1 3 0 3 1 3 2 3 2 3 0 3 3 3 0 3 2 3 2 3 1 3 0 3 1]; moves = lights_out_14(board); % [1 1 1 5 5 5 7 7 9 9 13 17 17 19 19 21 21 21 25 25 25] b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 2 2 2 moves = 2 2 2 7 moves = 2 2 2 7 17 moves = 2 2 2 7 17 22 22 22 moves = 2 2 2 7 17 22 22 22 3 moves = 2 2 2 7 17 22 22 22 3 8 8 moves = 2 2 2 7 17 22 22 22 3 8 8 13 13 13 moves = 2 2 2 7 17 22 22 22 3 8 8 13 13 13 18 18 moves = 2 2 2 7 17 22 22 22 3 8 8 13 13 13 18 18 23 moves = 2 2 2 7 17 22 22 22 3 8 8 13 13 13 18 18 23 4 4 moves = 2 2 2 7 17 22 22 22 3 8 8 13 13 13 18 18 23 4 4 9 9 moves = 2 2 2 7 17 22 22 22 3 8 8 13 13 13 18 18 23 4 4 9 9 14 14 moves = 2 2 2 7 17 22 22 22 3 8 8 13 13 13 18 18 23 4 4 9 9 14 14 19 19 moves = 2 2 2 7 17 22 22 22 3 8 8 13 13 13 18 18 23 4 4 9 9 14 14 19 19 24 24 moves = 2 2 2 7 17 22 22 22 3 8 8 13 13 13 18 18 23 4 4 9 9 14 14 19 19 24 24 10 10 moves = Columns 1 through 30 2 2 2 7 17 22 22 22 3 8 8 13 13 13 18 18 23 4 4 9 9 14 14 19 19 24 24 10 10 20 Column 31 20 moves = Columns 1 through 30 2 2 2 3 4 4 6 6 7 8 8 9 9 10 10 13 13 13 14 14 17 18 18 19 19 20 20 22 22 22 Columns 31 through 35 23 24 24 2 2 moves = Columns 1 through 30 2 2 2 3 4 4 6 6 7 8 8 9 9 10 10 13 13 13 14 14 17 18 18 19 19 20 20 22 22 22 Columns 31 through 37 23 24 24 2 2 7 7 moves = Columns 1 through 30 2 2 2 3 4 4 6 6 7 8 8 9 9 10 10 13 13 13 14 14 17 18 18 19 19 20 20 22 22 22 Columns 31 through 39 23 24 24 2 2 7 7 12 12 moves = Columns 1 through 30 2 2 2 3 4 4 6 6 7 8 8 9 9 10 10 13 13 13 14 14 17 18 18 19 19 20 20 22 22 22 Columns 31 through 41 23 24 24 2 2 7 7 12 12 18 18 moves = Columns 1 through 30 2 2 2 3 4 4 6 6 7 8 8 9 9 10 10 13 13 13 14 14 17 18 18 19 19 20 20 22 22 22 Columns 31 through 43 23 24 24 2 2 7 7 12 12 18 18 4 4 moves = Columns 1 through 30 2 2 2 3 4 4 6 6 7 8 8 9 9 10 10 13 13 13 14 14 17 18 18 19 19 20 20 22 22 22 Columns 31 through 45 23 24 24 2 2 7 7 12 12 18 18 4 4 9 9 moves = Columns 1 through 30 2 2 2 3 4 4 6 6 7 8 8 9 9 10 10 13 13 13 14 14 17 18 18 19 19 20 20 22 22 22 Columns 31 through 47 23 24 24 2 2 7 7 12 12 18 18 4 4 9 9 19 19 moves = Columns 1 through 30 2 2 2 3 4 4 6 6 7 8 8 9 9 10 10 13 13 13 14 14 17 18 18 19 19 20 20 22 22 22 Columns 31 through 49 23 24 24 2 2 7 7 12 12 18 18 4 4 9 9 19 19 24 24 moves = Columns 1 through 30 2 2 2 3 4 4 6 6 7 8 8 9 9 10 10 13 13 13 14 14 17 18 18 19 19 20 20 22 22 22 Columns 31 through 51 23 24 24 2 2 7 7 12 12 18 18 4 4 9 9 19 19 24 24 20 20

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test3 (line 6) moves = lights_out_14(board); % [1 1 1 5 5 5 7 7 9 9 13 17 17 19 19 21 21 21 25 25 25]

4   Fail
board = [2 1 1 1 2 1 2 3 2 1 1 3 0 3 1 1 2 3 2 1 2 1 1 1 2]; moves = lights_out_14(board); % [6:10 16:20 2:5:22 4:5:24] b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 2 2 moves = 2 2 7 7 7 moves = 2 2 7 7 7 12 12 12 moves = 2 2 7 7 7 12 12 12 17 17 17 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 8 8 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 8 8 18 18 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 8 8 18 18 23 23 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 8 8 18 18 23 23 4 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 8 8 18 18 23 23 4 9 9 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 8 8 18 18 23 23 4 9 9 14 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 8 8 18 18 23 23 4 9 9 14 19 19 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 8 8 18 18 23 23 4 9 9 14 19 19 24 moves = 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 8 8 18 18 23 23 4 9 9 14 19 19 24 5 5 moves = Columns 1 through 30 2 2 7 7 7 12 12 12 17 17 17 22 22 3 3 8 8 18 18 23 23 4 9 9 14 19 19 24 5 5 Columns 31 through 32 25 25 moves = Columns 1 through 30 1 1 2 2 3 3 4 5 5 6 6 6 6 7 7 7 8 8 9 9 12 12 12 14 17 17 17 18 18 19 Columns 31 through 40 19 22 22 23 23 24 25 25 2 2 moves = Columns 1 through 30 1 1 2 2 3 3 4 5 5 6 6 6 6 7 7 7 8 8 9 9 12 12 12 14 17 17 17 18 18 19 Columns 31 through 42 19 22 22 23 23 24 25 25 2 2 7 7 moves = Columns 1 through 30 1 1 2 2 3 3 4 5 5 6 6 6 6 7 7 7 8 8 9 9 12 12 12 14 17 17 17 18 18 19 Columns 31 through 44 19 22 22 23 23 24 25 25 2 2 7 7 3 3 moves = Columns 1 through 30 1 1 2 2 3 3 4 5 5 6 6 6 6 7 7 7 8 8 9 9 12 12 12 14 17 17 17 18 18 19 Columns 31 through 46 19 22 22 23 23 24 25 25 2 2 7 7 3 3 13 13 moves = Columns 1 through 30 1 1 2 2 3 3 4 5 5 6 6 6 6 7 7 7 8 8 9 9 12 12 12 14 17 17 17 18 18 19 Columns 31 through 48 19 22 22 23 23 24 25 25 2 2 7 7 3 3 13 13 9 9 moves = Columns 1 through 30 1 1 2 2 3 3 4 5 5 6 6 6 6 7 7 7 8 8 9 9 12 12 12 14 17 17 17 18 18 19 Columns 31 through 50 19 22 22 23 23 24 25 25 2 2 7 7 3 3 13 13 9 9 14 14 moves = Columns 1 through 30 1 1 2 2 3 3 4 5 5 6 6 6 6 7 7 7 8 8 9 9 12 12 12 14 17 17 17 18 18 19 Columns 31 through 52 19 22 22 23 23 24 25 25 2 2 7 7 3 3 13 13 9 9 14 14 19 19 moves = Columns 1 through 30 1 1 2 2 3 3 4 5 5 6 6 6 6 7 7 7 8 8 9 9 12 12 12 14 17 17 17 18 18 19 Columns 31 through 54 19 22 22 23 23 24 25 25 2 2 7 7 3 3 13 13 9 9 14 14 19 19 25 25

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test4 (line 6) moves = lights_out_14(board); % [6:10 16:20 2:5:22 4:5:24]

5   Fail
board = [1 0 3 1 3 2 2 2 3 2 0 2 3 1 2 0 0 0 1 0 3 2 1 2 1]; moves = lights_out_14(board); % [2 4 4 4:7 6 10:13 12 17:21 18:20 19 25] b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 2 2 2 moves = 2 2 2 12 moves = 2 2 2 12 17 17 17 moves = 2 2 2 12 17 17 17 22 moves = 2 2 2 12 17 17 17 22 3 3 3 moves = 2 2 2 12 17 17 17 22 3 3 3 8 8 moves = 2 2 2 12 17 17 17 22 3 3 3 8 8 13 13 moves = 2 2 2 12 17 17 17 22 3 3 3 8 8 13 13 23 23 moves = 2 2 2 12 17 17 17 22 3 3 3 8 8 13 13 23 23 9 9 9 moves = 2 2 2 12 17 17 17 22 3 3 3 8 8 13 13 23 23 9 9 9 24 24 24 moves = 2 2 2 12 17 17 17 22 3 3 3 8 8 13 13 23 23 9 9 9 24 24 24 5 5 moves = 2 2 2 12 17 17 17 22 3 3 3 8 8 13 13 23 23 9 9 9 24 24 24 5 5 10 10 10 moves = Columns 1 through 30 2 2 2 12 17 17 17 22 3 3 3 8 8 13 13 23 23 9 9 9 24 24 24 5 5 10 10 10 15 15 Column 31 15 moves = Columns 1 through 30 2 2 2 12 17 17 17 22 3 3 3 8 8 13 13 23 23 9 9 9 24 24 24 5 5 10 10 10 15 15 Columns 31 through 34 15 25 25 25 moves = Columns 1 through 30 1 1 2 2 2 3 3 3 5 5 6 6 8 8 9 9 9 10 10 10 12 13 13 15 15 15 17 17 17 22 Columns 31 through 40 23 23 24 24 24 25 25 25 12 12 moves = Columns 1 through 30 1 1 2 2 2 3 3 3 5 5 6 6 8 8 9 9 9 10 10 10 12 13 13 15 15 15 17 17 17 22 Columns 31 through 42 23 23 24 24 24 25 25 25 12 12 3 3 moves = Columns 1 through 30 1 1 2 2 2 3 3 3 5 5 6 6 8 8 9 9 9 10 10 10 12 13 13 15 15 15 17 17 17 22 Columns 31 through 44 23 23 24 24 24 25 25 25 12 12 3 3 13 13 moves = Columns 1 through 30 1 1 2 2 2 3 3 3 5 5 6 6 8 8 9 9 9 10 10 10 12 13 13 15 15 15 17 17 17 22 Columns 31 through 46 23 23 24 24 24 25 25 25 12 12 3 3 13 13 18 18 moves = Columns 1 through 30 1 1 2 2 2 3 3 3 5 5 6 6 8 8 9 9 9 10 10 10 12 13 13 15 15 15 17 17 17 22 Columns 31 through 48 23 23 24 24 24 25 25 25 12 12 3 3 13 13 18 18 4 4 moves = Columns 1 through 30 1 1 2 2 2 3 3 3 5 5 6 6 8 8 9 9 9 10 10 10 12 13 13 15 15 15 17 17 17 22 Columns 31 through 50 23 23 24 24 24 25 25 25 12 12 3 3 13 13 18 18 4 4 14 14 moves = Columns 1 through 30 1 1 2 2 2 3 3 3 5 5 6 6 8 8 9 9 9 10 10 10 12 13 13 15 15 15 17 17 17 22 Columns 31 through 52 23 23 24 24 24 25 25 25 12 12 3 3 13 13 18 18 4 4 14 14 24 24 moves = Columns 1 through 30 1 1 2 2 2 3 3 3 5 5 6 6 8 8 9 9 9 10 10 10 12 13 13 15 15 15 17 17 17 22 Columns 31 through 54 23 23 24 24 24 25 25 25 12 12 3 3 13 13 18 18 4 4 14 14 24 24 20 20 moves = Columns 1 through 30 1 1 2 2 2 3 3 3 5 5 6 6 8 8 9 9 9 10 10 10 12 13 13 15 15 15 17 17 17 22 Columns 31 through 56 23 23 24 24 24 25 25 25 12 12 3 3 13 13 18 18 4 4 14 14 24 24 20 20 25 25

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test5 (line 6) moves = lights_out_14(board); % [2 4 4 4:7 6 10:13 12 17:21 18:20 19 25]

6   Pass
board = [0 2 0 1 0 2 2 3 1 1 0 3 0 3 0 1 1 3 2 2 0 1 0 2 0]; moves = lights_out_14(board); % [7 7 9 9 9 17 17 17 19 19] b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 7 7 moves = 7 7 17 17 17 moves = 7 7 17 17 17 9 9 9 moves = 7 7 17 17 17 9 9 9 19 19

7   Fail
board = [0 3 1 3 0 0 2 2 2 0 0 1 1 1 0 0 2 2 2 0 0 3 1 3 0]; moves = lights_out_14(board); % [11:15 12:14 13] b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 7 moves = 7 12 12 12 moves = 7 12 12 12 17 moves = 7 12 12 12 17 3 3 3 moves = 7 12 12 12 17 3 3 3 8 8 moves = 7 12 12 12 17 3 3 3 8 8 13 moves = 7 12 12 12 17 3 3 3 8 8 13 18 18 moves = 7 12 12 12 17 3 3 3 8 8 13 18 18 23 23 23 moves = 7 12 12 12 17 3 3 3 8 8 13 18 18 23 23 23 4 4 4 moves = 7 12 12 12 17 3 3 3 8 8 13 18 18 23 23 23 4 4 4 14 14 14 moves = 7 12 12 12 17 3 3 3 8 8 13 18 18 23 23 23 4 4 4 14 14 14 24 24 24 moves = 7 12 12 12 17 3 3 3 8 8 13 18 18 23 23 23 4 4 4 14 14 14 24 24 24 5 5 moves = 7 12 12 12 17 3 3 3 8 8 13 18 18 23 23 23 4 4 4 14 14 14 24 24 24 5 5 10 10 moves = Columns 1 through 30 7 12 12 12 17 3 3 3 8 8 13 18 18 23 23 23 4 4 4 14 14 14 24 24 24 5 5 10 10 15 Column 31 15 moves = Columns 1 through 30 7 12 12 12 17 3 3 3 8 8 13 18 18 23 23 23 4 4 4 14 14 14 24 24 24 5 5 10 10 15 Columns 31 through 33 15 20 20 moves = Columns 1 through 30 7 12 12 12 17 3 3 3 8 8 13 18 18 23 23 23 4 4 4 14 14 14 24 24 24 5 5 10 10 15 Columns 31 through 35 15 20 20 25 25 moves = Columns 1 through 30 1 1 3 3 3 4 4 4 5 5 6 6 7 8 8 10 10 12 12 12 13 14 14 14 15 15 17 18 18 20 Columns 31 through 41 20 23 23 23 24 24 24 25 25 12 12 moves = Columns 1 through 30 1 1 3 3 3 4 4 4 5 5 6 6 7 8 8 10 10 12 12 12 13 14 14 14 15 15 17 18 18 20 Columns 31 through 43 20 23 23 23 24 24 24 25 25 12 12 3 3 moves = Columns 1 through 30 1 1 3 3 3 4 4 4 5 5 6 6 7 8 8 10 10 12 12 12 13 14 14 14 15 15 17 18 18 20 Columns 31 through 45 20 23 23 23 24 24 24 25 25 12 12 3 3 13 13 moves = Columns 1 through 30 1 1 3 3 3 4 4 4 5 5 6 6 7 8 8 10 10 12 12 12 13 14 14 14 15 15 17 18 18 20 Columns 31 through 47 20 23 23 23 24 24 24 25 25 12 12 3 3 13 13 18 18 moves = Columns 1 through 30 1 1 3 3 3 4 4 4 5 5 6 6 7 8 8 10 10 12 12 12 13 14 14 14 15 15 17 18 18 20 Columns 31 through 49 20 23 23 23 24 24 24 25 25 12 12 3 3 13 13 18 18 4 4 moves = Columns 1 through 30 1 1 3 3 3 4 4 4 5 5 6 6 7 8 8 10 10 12 12 12 13 14 14 14 15 15 17 18 18 20 Columns 31 through 51 20 23 23 23 24 24 24 25 25 12 12 3 3 13 13 18 18 4 4 14 14 moves = Columns 1 through 30 1 1 3 3 3 4 4 4 5 5 6 6 7 8 8 10 10 12 12 12 13 14 14 14 15 15 17 18 18 20 Columns 31 through 53 20 23 23 23 24 24 24 25 25 12 12 3 3 13 13 18 18 4 4 14 14 24 24 moves = Columns 1 through 30 1 1 3 3 3 4 4 4 5 5 6 6 7 8 8 10 10 12 12 12 13 14 14 14 15 15 17 18 18 20 Columns 31 through 55 20 23 23 23 24 24 24 25 25 12 12 3 3 13 13 18 18 4 4 14 14 24 24 20 20 moves = Columns 1 through 30 1 1 3 3 3 4 4 4 5 5 6 6 7 8 8 10 10 12 12 12 13 14 14 14 15 15 17 18 18 20 Columns 31 through 57 20 23 23 23 24 24 24 25 25 12 12 3 3 13 13 18 18 4 4 14 14 24 24 20 20 25 25

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test7 (line 6) moves = lights_out_14(board); % [11:15 12:14 13]

8   Fail
board = [3 1 0 0 0 1 2 3 0 0 0 3 1 3 0 0 0 3 2 1 0 0 0 1 3]; moves = lights_out_14(board); % [1 7 7 13 13 13 19 19 25] b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 2 moves = 2 7 7 7 moves = 2 7 7 7 3 3 3 moves = 2 7 7 7 3 3 3 8 8 moves = 2 7 7 7 3 3 3 8 8 13 13 moves = 2 7 7 7 3 3 3 8 8 13 13 4 4 moves = 2 7 7 7 3 3 3 8 8 13 13 4 4 9 9 9 moves = 2 7 7 7 3 3 3 8 8 13 13 4 4 9 9 9 14 14 14 moves = 2 7 7 7 3 3 3 8 8 13 13 4 4 9 9 9 14 14 14 19 19 19 moves = 2 7 7 7 3 3 3 8 8 13 13 4 4 9 9 9 14 14 14 19 19 19 10 10 moves = 2 7 7 7 3 3 3 8 8 13 13 4 4 9 9 9 14 14 14 19 19 19 10 10 15 15

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test8 (line 6) moves = lights_out_14(board); % [1 7 7 13 13 13 19 19 25]

9   Fail
board = [1 2 1 2 1 3 0 1 0 3 3 2 0 2 2 2 2 3 0 1 1 3 0 2 3]; moves = lights_out_14(board); % on your own b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 2 2 2 moves = 2 2 2 7 7 moves = 2 2 2 7 7 12 12 12 moves = 2 2 2 7 7 12 12 12 17 17 moves = 2 2 2 7 7 12 12 12 17 17 22 22 22 moves = 2 2 2 7 7 12 12 12 17 17 22 22 22 4 4 moves = 2 2 2 7 7 12 12 12 17 17 22 22 22 4 4 14 moves = 2 2 2 7 7 12 12 12 17 17 22 22 22 4 4 14 24 24 24 moves = 2 2 2 7 7 12 12 12 17 17 22 22 22 4 4 14 24 24 24 10 10 10 moves = 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 moves = 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 moves = 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 moves = 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 32 8 8 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 33 8 8 13 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 35 8 8 13 18 18 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 38 8 8 13 18 18 9 9 9 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 39 8 8 13 18 18 9 9 9 14 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 40 8 8 13 18 18 9 9 9 14 19 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 42 8 8 13 18 18 9 9 9 14 19 24 24 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 44 8 8 13 18 18 9 9 9 14 19 24 24 10 10 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 46 8 8 13 18 18 9 9 9 14 19 24 24 10 10 15 15 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 48 8 8 13 18 18 9 9 9 14 19 24 24 10 10 15 15 20 20 moves = Columns 1 through 30 1 2 2 2 4 4 6 6 7 7 10 10 10 12 12 12 14 17 17 22 22 22 24 24 24 2 7 12 12 3 Columns 31 through 49 8 8 13 18 18 9 9 9 14 19 24 24 10 10 15 15 20 20 25

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test9 (line 6) moves = lights_out_14(board); % on your own

10   Fail
board = [1 1 0 0 0 3 2 2 0 0 1 1 3 2 0 0 2 1 2 1 0 0 1 3 1]; moves = lights_out_14(board); b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 2 2 2 moves = 2 2 2 7 7 7 moves = 2 2 2 7 7 7 3 3 3 moves = 2 2 2 7 7 7 3 3 3 13 13 13 moves = 2 2 2 7 7 7 3 3 3 13 13 13 4 moves = 2 2 2 7 7 7 3 3 3 13 13 13 4 9 9 moves = 2 2 2 7 7 7 3 3 3 13 13 13 4 9 9 14 14 moves = 2 2 2 7 7 7 3 3 3 13 13 13 4 9 9 14 14 19 19 19 moves = 2 2 2 7 7 7 3 3 3 13 13 13 4 9 9 14 14 19 19 19 5 5 moves = 2 2 2 7 7 7 3 3 3 13 13 13 4 9 9 14 14 19 19 19 5 5 10 moves = 2 2 2 7 7 7 3 3 3 13 13 13 4 9 9 14 14 19 19 19 5 5 10 15 moves = 2 2 2 7 7 7 3 3 3 13 13 13 4 9 9 14 14 19 19 19 5 5 10 15 20 moves = 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Column 31 7 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Columns 31 through 34 7 12 12 12 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Columns 31 through 37 7 12 12 12 3 3 3 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Columns 31 through 40 7 12 12 12 3 3 3 13 13 13 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Columns 31 through 41 7 12 12 12 3 3 3 13 13 13 18 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Columns 31 through 44 7 12 12 12 3 3 3 13 13 13 18 4 4 4 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Columns 31 through 45 7 12 12 12 3 3 3 13 13 13 18 4 4 4 14 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Columns 31 through 48 7 12 12 12 3 3 3 13 13 13 18 4 4 4 14 24 24 24 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Columns 31 through 50 7 12 12 12 3 3 3 13 13 13 18 4 4 4 14 24 24 24 5 5 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Columns 31 through 53 7 12 12 12 3 3 3 13 13 13 18 4 4 4 14 24 24 24 5 5 20 20 20 moves = Columns 1 through 30 1 2 2 2 3 3 3 4 5 5 6 7 7 7 9 9 10 13 13 13 14 14 15 19 19 19 20 2 2 7 Columns 31 through 54 7 12 12 12 3 3 3 13 13 13 18 4 4 4 14 24 24 24 5 5 20 20 20 25

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test10 (line 6) moves = lights_out_14(board);

11   Fail
board = [3 2 3 3 0 3 1 2 2 3 3 0 1 0 2 2 3 3 3 1 3 1 2 2 3]; moves = lights_out_14(board); b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 2 moves = 2 7 7 moves = 2 7 7 12 moves = 2 7 7 12 17 moves = 2 7 7 12 17 3 3 moves = 2 7 7 12 17 3 3 8 8 8 moves = 2 7 7 12 17 3 3 8 8 8 13 13 moves = 2 7 7 12 17 3 3 8 8 8 13 13 4 4 4 moves = 2 7 7 12 17 3 3 8 8 8 13 13 4 4 4 9 9 9 moves = 2 7 7 12 17 3 3 8 8 8 13 13 4 4 4 9 9 9 14 moves = 2 7 7 12 17 3 3 8 8 8 13 13 4 4 4 9 9 9 14 19 moves = 2 7 7 12 17 3 3 8 8 8 13 13 4 4 4 9 9 9 14 19 24 24 moves = 2 7 7 12 17 3 3 8 8 8 13 13 4 4 4 9 9 9 14 19 24 24 5 5 moves = 2 7 7 12 17 3 3 8 8 8 13 13 4 4 4 9 9 9 14 19 24 24 5 5 10 10 10 moves = 2 7 7 12 17 3 3 8 8 8 13 13 4 4 4 9 9 9 14 19 24 24 5 5 10 10 10 15 15 moves = 2 7 7 12 17 3 3 8 8 8 13 13 4 4 4 9 9 9 14 19 24 24 5 5 10 10 10 15 15 20

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test11 (line 6) moves = lights_out_14(board);

12   Fail
board = [1 2 3 0 1 1 2 1 1 2 1 0 2 0 0 1 0 0 0 0 0 3 2 2 0]; moves = lights_out_14(board); b1 = diag(ones(1,5),0) + diag(ones(1,4),1) + diag(ones(1,4),-1); b2 = eye(5); b3 = zeros(5); b_map = [b1,b2,b3,b3,b3;b2,b1,b2,b3,b3;b3,b2,b1,b2,b3;b3,b3,b2,b1,b2;b3,b3,b3,b2,b1]; for i = 1:numel(moves) board = mod(board + reshape(b_map(moves(i),:),[5,5]),4); %remove semicolon to display progress end assert(sum(abs(board(:)))==0)

moves = 2 2 2 moves = 2 2 2 7 7 moves = 2 2 2 7 7 12 moves = 2 2 2 7 7 12 22 22 22 moves = 2 2 2 7 7 12 22 22 22 3 3 moves = 2 2 2 7 7 12 22 22 22 3 3 18 18 18 moves = 2 2 2 7 7 12 22 22 22 3 3 18 18 18 23 23 23 moves = 2 2 2 7 7 12 22 22 22 3 3 18 18 18 23 23 23 4 4 moves = 2 2 2 7 7 12 22 22 22 3 3 18 18 18 23 23 23 4 4 14 14 moves = 2 2 2 7 7 12 22 22 22 3 3 18 18 18 23 23 23 4 4 14 14 19 19 moves = 2 2 2 7 7 12 22 22 22 3 3 18 18 18 23 23 23 4 4 14 14 19 19 24 24 24 moves = 2 2 2 7 7 12 22 22 22 3 3 18 18 18 23 23 23 4 4 14 14 19 19 24 24 24 5 5 5 moves = Columns 1 through 30 2 2 2 7 7 12 22 22 22 3 3 18 18 18 23 23 23 4 4 14 14 19 19 24 24 24 5 5 5 20 Column 31 20 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 36 23 23 24 24 24 12 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 39 23 23 24 24 24 12 3 3 3 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 42 23 23 24 24 24 12 3 3 3 13 13 13 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 45 23 23 24 24 24 12 3 3 3 13 13 13 18 18 18 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 46 23 23 24 24 24 12 3 3 3 13 13 13 18 18 18 4 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 48 23 23 24 24 24 12 3 3 3 13 13 13 18 18 18 4 9 9 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 49 23 23 24 24 24 12 3 3 3 13 13 13 18 18 18 4 9 9 14 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 51 23 23 24 24 24 12 3 3 3 13 13 13 18 18 18 4 9 9 14 19 19 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 52 23 23 24 24 24 12 3 3 3 13 13 13 18 18 18 4 9 9 14 19 19 24 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 54 23 23 24 24 24 12 3 3 3 13 13 13 18 18 18 4 9 9 14 19 19 24 5 5 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 55 23 23 24 24 24 12 3 3 3 13 13 13 18 18 18 4 9 9 14 19 19 24 5 5 20 moves = Columns 1 through 30 1 2 2 2 3 3 4 4 5 5 5 6 6 6 7 7 12 14 14 18 18 18 19 19 20 20 22 22 22 23 Columns 31 through 56 23 23 24 24 24 12 3 3 3 13 13 13 18 18 18 4 9 9 14 19 19 24 5 5 20 25

Matrix dimensions must agree. Error in lights_out_14>remTrios (line 36) while ~isempty(find(moves(1:end-2)-moves(4:end)==0,1)) Error in lights_out_14>findMoves (line 31) moves = remTrios(moves); Error in lights_out_14 (line 3) moves = findMoves(board); Error in Test12 (line 6) moves = lights_out_14(board);