Cody

Solution 27605

Submitted on 3 Feb 2012 by JoJo
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)))

a = (1,1) 1 (3,1) 1 (5,1) 1 (2,2) 1 (4,2) 1 (1,3) 1 (3,3) 1 (5,3) 1 (2,4) 1 (4,4) 1 (1,5) 1 (3,5) 1 (5,5) 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)))

a = (1,1) 1 (3,1) 1 (2,2) 1 (4,2) 1 (1,3) 1 (3,3) 1 (2,4) 1 (4,4) 1

Suggested Problems

More from this Author95