Cody

# Problem 3043. Fill-a-pix - Solver (basic)

Solution 1212314

Submitted on 14 Jun 2017 by yurenchu
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 = [-1,-1,-1,-1,1; -1,9,-1,-1,-1; -1,8,8,-1,-1; -1,-1,-1,-1,4; 4,-1,5,-1,2]; board(board==-1) = NaN; solution = [1,1,1,0,0; 1,1,1,1,0; 1,1,1,1,1; 1,1,0,1,0; 1,1,1,1,0]; assert(isequal(fill_a_pix_solver_basic(board),solution))

Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0

2   Pass
board = [-1,-1,-1,-1,-1,-1,-1,-1,0,-1; -1,8,8,-1,2,-1,0,-1,-1,-1; 5,-1,8,-1,-1,-1,-1,-1,-1,-1; -1,-1,-1,-1,-1,2,-1,-1,-1,2; 1,-1,-1,-1,4,5,6,-1,-1,-1; -1,0,-1,-1,-1,7,9,-1,-1,6; -1,-1,-1,6,-1,-1,9,-1,-1,6; -1,-1,6,6,8,7,8,7,-1,5; -1,4,-1,6,6,6,-1,6,-1,4; -1,-1,-1,-1,-1,-1,3,-1,-1,-1]; board(board==-1) = NaN; solution = [0,1,1,0,0,0,0,0,0,0; 1,1,1,1,0,0,0,0,0,0; 1,1,1,1,0,0,0,0,0,0; 0,1,1,0,0,0,0,0,0,0; 0,0,0,0,0,1,1,1,1,1; 0,0,0,1,1,1,1,1,1,1; 0,0,0,1,0,1,1,1,1,1; 0,1,1,1,1,1,1,1,1,1; 0,1,0,1,1,1,0,1,0,1; 0,0,1,0,0,0,1,0,1,0]; assert(isequal(fill_a_pix_solver_basic(board),solution))

Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 1 Locb = 1 Lia = logical 1 Locb = 2 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia ...

3   Pass
board = [-1,2,3,-1,-1,0,-1,-1,-1,-1; -1,-1,-1,-1,3,-1,2,-1,-1,6; -1,-1,5,-1,5,3,-1,5,7,4; -1,4,-1,5,-1,5,-1,6,-1,3; -1,-1,4,-1,5,-1,6,-1,-1,3; -1,-1,-1,2,-1,5,-1,-1,-1,-1; 4,-1,1,-1,-1,-1,1,1,-1,-1; 4,-1,1,-1,-1,-1,1,-1,4,-1; -1,-1,-1,-1,6,-1,-1,-1,-1,4; -1,4,4,-1,-1,-1,-1,4,-1,-1]; board(board==-1) = NaN; solution = [0,1,1,0,0,0,0,0,1,1; 0,0,0,1,0,0,0,1,1,1; 0,0,1,1,1,0,0,1,1,1; 0,1,1,0,1,1,0,1,0,0; 0,1,0,0,0,1,1,1,1,0; 1,1,0,0,1,1,0,0,1,1; 1,0,0,0,1,0,0,0,0,1; 1,0,0,0,1,0,0,0,0,1; 1,1,0,0,1,1,0,0,1,1; 0,1,1,1,1,1,1,1,1,0]; assert(isequal(fill_a_pix_solver_basic(board),solution))

Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia ...

4   Pass
board = [0,-1,-1,4,3,2,1,-1,-1,-1,-1,-1,3,-1,-1; -1,-1,5,-1,-1,4,-1,-1,4,4,-1,-1,-1,-1,3; -1,5,4,5,4,5,5,-1,5,3,-1,1,2,-1,3; 4,-1,-1,-1,4,-1,-1,4,2,-1,1,-1,-1,-1,-1; -1,-1,5,4,-1,2,2,-1,1,0,-1,-1,7,5,-1; -1,-1,-1,5,-1,-1,0,-1,-1,-1,-1,4,5,-1,2; 4,-1,-1,5,4,2,0,0,-1,-1,-1,5,6,-1,-1; 5,-1,-1,6,5,-1,-1,-1,-1,-1,3,3,3,-1,3; -1,-1,5,-1,5,3,-1,-1,-1,-1,-1,-1,3,-1,-1; 5,-1,-1,6,5,-1,3,5,-1,6,-1,-1,0,-1,0; -1,-1,5,-1,4,3,2,4,5,-1,4,-1,-1,1,-1; -1,7,-1,-1,5,-1,-1,1,-1,5,5,5,-1,-1,-1; -1,-1,6,4,4,4,3,1,2,4,-1,-1,6,4,-1; -1,5,-1,6,-1,-1,-1,-1,-1,4,6,-1,-1,-1,-1; -1,-1,-1,-1,-1,-1,3,2,0,-1,4,4,3,-1,2]; board(board==-1) = NaN; solution = [0,0,0,1,1,0,0,0,0,0,1,1,1,1,0; 0,0,1,0,1,0,0,1,1,1,0,0,0,0,1; 1,1,1,1,0,1,1,0,1,0,0,0,0,0,1; 1,0,0,0,1,0,1,1,0,0,0,0,1,1,0; 0,1,1,1,0,0,0,0,0,0,0,1,1,0,0; 0,1,0,1,0,0,0,0,0,0,0,1,1,1,0; 1,1,1,0,1,0,0,0,0,0,0,0,0,0,1; 1,0,0,1,1,0,0,0,0,0,1,1,1,1,1; 1,1,1,1,0,1,0,0,1,1,0,0,0,0,0; 1,0,0,1,0,0,1,1,1,1,0,0,0,0,0; 1,1,1,1,1,0,0,0,1,0,1,0,0,0,0; 1,1,0,0,1,0,0,0,0,1,0,1,1,0,0; 0,1,1,1,0,1,0,0,0,1,1,0,1,1,0; 0,1,1,0,0,1,1,0,0,0,1,1,0,1,0; 0,0,1,1,1,0,1,0,0,0,1,1,0,0,1]; assert(isequal(fill_a_pix_solver_basic(board),solution))

Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia ...

5   Pass
board = NaN(9); solution = NaN(9); for i = 1:3 for j = 1:3 if randi(2) == 2 board(i*3-1,j*3-1) = 9; solution((i*3-2):(i*3),(j*3-2):(j*3)) = 1; else board(i*3-1,j*3-1) = 0; solution((i*3-2):(i*3),(j*3-2):(j*3)) = 0; end end end assert(isequal(fill_a_pix_solver_basic(board),solution))

Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 2 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 1 Locb = 1 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0 Lia = logical 0 Locb = 0