Cody

Solution 1970385

Submitted on 10 Oct 2019 by Charles Juenger
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
b = [0 1 1 0 2; 0 1 2 2 1; 1 0 2 2 2; 1 1 2 2 1; 1 1 2 1 0]; result_correct = 2; assert(isequal(c4winner(b),result_correct))

a = 0 1 2 2 0 b = 2 2 2 1 1 c = 0 1 2 2 0 d = 2 2 2 1 1 a = 1 2 2 1 b = 0 2 0 1 c = 0 0 2 1 d = 1 2 2 1 a = 0 1 2 2 0 b = 2 2 2 1 1 c = 0 1 2 2 0 d = 2 2 2 1 1 a = 1 2 2 1 b = 0 2 0 1 c = 0 0 2 1 d = 1 2 2 1 a = 0 1 2 2 0 b = 2 2 2 1 1 c = 0 1 2 2 0 d = 2 2 2 1 1 a = 1 2 2 1 b = 0 2 0 1 c = 0 0 2 1 d = 1 2 2 1 a = 0 1 2 2 0 b = 2 2 2 1 1 c = 0 1 2 2 0 d = 2 2 2 1 1 a = 1 2 2 1 b = 0 2 0 1 c = 0 0 2 1 d = 1 2 2 1 a = 0 1 2 2 0 b = 2 2 2 1 1 c = 0 1 2 2 0 d = 2 2 2 1 1 a = 1 2 2 1 b = 0 2 0 1 c = 0 0 2 1 d = 1 2 2 1 y = 2

2   Pass
b = [0 0 0 0; 1 0 2 0; 1 1 1 1; 0 0 2 2]; result_correct = 1; assert(isequal(c4winner(b),result_correct))

a = 0 0 1 2 b = 0 2 1 0 c = 0 0 1 2 d = 0 2 1 0 a = 0 0 1 2 b = 0 2 1 0 c = 0 0 1 2 d = 0 2 1 0 a = 0 0 1 2 b = 0 2 1 0 c = 0 0 1 2 d = 0 2 1 0 y = 1 a = 0 0 1 2 b = 0 2 1 0 c = 0 0 1 2 d = 0 2 1 0

3   Pass
b = [0 0 0 0 0 1; 2 2 0 0 2 2; 0 0 0 0 0 1; 2 0 0 1 1 0; 0 0 0 1 0 0; 0 0 1 0 2 2]; result_correct = 1; assert(isequal(c4winner(b),result_correct))

a = 0 2 0 1 0 2 b = 1 2 0 0 0 0 c = 0 2 0 1 0 2 d = 1 2 0 0 0 0 a = 0 0 0 1 0 b = 0 0 0 0 0 c = 2 0 0 1 2 d = 2 0 1 0 0 a = 0 0 0 0 b = 0 0 0 2 c = 0 0 0 0 d = 1 1 1 1 y = 1 a = 0 2 0 1 0 2 b = 1 2 0 0 0 0 c = 0 2 0 1 0 2 d = 1 2 0 0 0 0 a = 0 0 0 1 0 b = 0 0 0 0 0 c = 2 0 0 1 2 d = 2 0 1 0 0 a = 0 0 0 0 b = 0 0 0 2 c = 0 0 0 0 d = 1 1 1 1 y = 1 a = 0 2 0 1 0 2 b = 1 2 0 0 0 0 c = 0 2 0 1 0 2 d = 1 2 0 0 0 0 a = 0 0 0 1 0 b = 0 0 0 0 0 c = 2 0 0 1 2 d = 2 0 1 0 0 a = 0 0 0 0 b = 0 0 0 2 c = 0 0 0 0 d = 1 1 1 1 y = 1 a = 0 2 0 1 0 2 b = 1 2 0 0 0 0 c = 0 2 0 1 0 2 d = 1 2 0 0 0 0 a = 0 0 0 1 0 b = 0 0 0 0 0 c = 2 0 0 1 2 d = 2 0 1 0 0 a = 0 0 0 0 b = 0 0 0 2 c = 0 0 0 0 d = 1 1 1 1 y = 1 a = 0 2 0 1 0 2 b = 1 2 0 0 0 0 c = 0 2 0 1 0 2 d = 1 2 0 0 0 0 a = 0 0 0 1 0 b = 0 0 0 0 0 c = 2 0 0 1 2 d = 2 0 1 0 0 a = 0 0 0 0 b = 0 0 0 2 c = 0 0 0 0 d = 1 1 1 1 y = 1 a = 0 2 0 1 0 2 b = 1 2 0 0 0 0 c = 0 2 0 1 0 2 d = 1 2 0 0 0 0 a = 0 0 0 1 0 b = 0 0 0 0 0 c = 2 0 0 1 2 d = 2 0 1 0 0 a = 0 0 0 0 b = 0 0 0 2 c = 0 0 0 0 d = 1 1 1 1 y = 1

4   Pass
b = [0 0 0 0; 1 0 0 0; 0 0 0 0; 0 0 0 2]; result_correct = 0; assert(isequal(c4winner(b),result_correct))

a = 0 0 0 2 b = 0 0 0 0 c = 0 0 0 2 d = 0 0 0 0 a = 0 0 0 2 b = 0 0 0 0 c = 0 0 0 2 d = 0 0 0 0 a = 0 0 0 2 b = 0 0 0 0 c = 0 0 0 2 d = 0 0 0 0 a = 0 0 0 2 b = 0 0 0 0 c = 0 0 0 2 d = 0 0 0 0

5   Pass
b = [0 0 0 0; 1 1 1 1; 0 0 0 0; 0 0 0 2]; result_correct = 1; assert(isequal(c4winner(b),result_correct))

a = 0 1 0 2 b = 0 1 0 0 c = 0 1 0 2 d = 0 1 0 0 a = 0 1 0 2 b = 0 1 0 0 c = 0 1 0 2 d = 0 1 0 0 y = 1 a = 0 1 0 2 b = 0 1 0 0 c = 0 1 0 2 d = 0 1 0 0 a = 0 1 0 2 b = 0 1 0 0 c = 0 1 0 2 d = 0 1 0 0

6   Pass
b = [0 0 2 2; 1 0 2 0; 1 2 2 1; 2 0 1 2]; result_correct = 2; assert(isequal(c4winner(b),result_correct))

a = 0 0 2 2 b = 2 2 2 2 c = 0 0 2 2 d = 2 2 2 2 y = 2 a = 0 0 2 2 b = 2 2 2 2 c = 0 0 2 2 d = 2 2 2 2 y = 2 a = 0 0 2 2 b = 2 2 2 2 c = 0 0 2 2 d = 2 2 2 2 y = 2 a = 0 0 2 2 b = 2 2 2 2 c = 0 0 2 2 d = 2 2 2 2 y = 2

7   Pass
b = [0 0 0 0; 1 0 1 1; 0 0 2 0; 0 2 0 2]; result_correct = 0; assert(isequal(c4winner(b),result_correct))

a = 0 0 2 2 b = 0 1 0 0 c = 0 0 2 2 d = 0 1 0 0 a = 0 0 2 2 b = 0 1 0 0 c = 0 0 2 2 d = 0 1 0 0 a = 0 0 2 2 b = 0 1 0 0 c = 0 0 2 2 d = 0 1 0 0 a = 0 0 2 2 b = 0 1 0 0 c = 0 0 2 2 d = 0 1 0 0