Cody

# Problem 45355. Connect Four - 03

Solution 2150385

Submitted on 4 Mar 2020 by Nikolaos Nikolaou
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
x = [ 1 1 1 1 1 1 1 1; 2 2 2 2 2 2 2 2; 2 1 2 1 2 1 2 1; 1 2 1 2 1 2 1 2; 2 1 2 1 2 1 2 1; 1 2 1 2 1 2 1 1]; assert(isequal(connect_four_2(x),2))

win = 2 y = 2

2   Pass
x = [ 1 1 1 1 1 1 1 1; 2 2 2 2 2 2 2 2; 2 1 2 1 0 1 2 1; 1 2 1 2 1 2 1 2; 2 1 2 1 2 1 2 1; 1 2 1 2 1 2 1 1]; assert(isequal(connect_four_2(x),'invalid'))

y = 'invalid'

3   Pass
x = [ 1 1 1 1 1 1 1 1 2; 2 2 2 2 2 2 2 2 1; 2 1 2 1 2 1 2 1 2; 1 2 1 2 1 2 1 2 2; 2 1 2 1 2 1 2 1 2; 1 2 1 2 1 2 1 1 2]; assert(isequal(connect_four_2(x),2))

win = 2 y = 2

4   Pass
x = [1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 1 2 1 2 1 2 1 2 1 2 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1]; assert(isequal(connect_four_2(x),0))

win = 1 win = 0 y = 0

5   Pass
x = [2 2 1 1 2 1 2 1 1 2 2 1 1 1 1 2 1 2 1 1 1 2 2 2 2 1 2 2 2 1 1 2 1 1 2 1 2 1 2 2 2 1 1 2 2 2 2 1 1 1 2 1 2 1 2 1 1 2 1 1 1 1 2 1]; assert(isequal(connect_four_2(x),0))

win = 0 y = 0

6   Pass
x = [2 2 1 1 2 1 2 1 1 2 2 1 1 1 1 2 1 2 1 1 1 2 2 2 2 1 2 2 2 1 1 2 1 1 2 1 2 1 2 2 2 1 1 2 2 2 2 1 1 1 2 1 2 1 2 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 1 1]; assert(isequal(connect_four_2(x),1))

win = 1 y = 1

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!