Cody

Solution 2111248

Submitted on 30 Jan 2020 by Yoshimasa Nakatani
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
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)))

n = 5 N = 1 2 3 4 5 y0 = 1 y = 1 y0 = 0 y = 1 0 y0 = 1 y = 1 0 1 y0 = 0 y = 1 0 1 0 y0 = 1 y = 1 0 1 0 1 z0 = 0 z = 0 z0 = 1 z = 0 1 z0 = 0 z = 0 1 0 z0 = 1 z = 0 1 0 1 z0 = 0 z = 0 1 0 1 0 Z = 1 0 1 0 1 Z = 1 0 1 0 1 0 1 0 1 0 Z = 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Z = 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 Z = 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 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)))

n = 4 N = 1 2 3 4 y0 = 1 y = 1 y0 = 0 y = 1 0 y0 = 1 y = 1 0 1 y0 = 0 y = 1 0 1 0 z0 = 0 z = 0 z0 = 1 z = 0 1 z0 = 0 z = 0 1 0 z0 = 1 z = 0 1 0 1 Z = 1 0 1 0 Z = 1 0 1 0 0 1 0 1 Z = 1 0 1 0 0 1 0 1 1 0 1 0 Z = 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 a = 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1