Cody

Solution 186732

Submitted on 5 Jan 2013 by Ken Campbell
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
%% n = 5; a = [1 0 1 0 1; 0 1 0 1 0; 1 0 1 0 1; 0 1 0 1 0; 1 0 1 0 1]; assert(isequal(a,checkerboard(n)))

r = Columns 1 through 16 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 Columns 17 through 25 2 3 4 5 1 2 3 4 5 c = Columns 1 through 16 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 Columns 17 through 25 4 4 4 4 5 5 5 5 5 a = 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

2   Pass
%% n = 4; a = [1 0 1 0; 0 1 0 1; 1 0 1 0; 0 1 0 1]; assert(isequal(a,checkerboard(n)))

r = 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 c = 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 a = 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1