Cody

Problem 45354. Connect Four - 01

Solution 2150233

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

p = 1×1 cell array {4×4 double} p = 1×2 cell array {4×4 double} {4×4 double} p = 1×3 cell array {4×4 double} {4×4 double} {4×1 double} p = 1×4 cell array {4×4 double} {4×4 double} {4×1 double} {1×4 double} score1 = 2 score2 = 2

Output argument "win" (and maybe others) not assigned during call to "connect_four". Error in Test1 (line 7) assert(isequal(connect_four(x),1))

2   Fail
x =[ 2 2 1 1 2 1 2 1 2 2 1 1 1 1 1 2 1 1 2 2 2 2 1 2 2 2 1 1 1 1 2 1 2 1 1 2 1 1 2 2 2 2]; assert(isequal(connect_four(x),0))

p = 1×1 cell array {4×4 double} p = 1×2 cell array {4×4 double} {4×4 double} p = 1×3 cell array {4×4 double} {4×4 double} {4×1 double} p = 1×4 cell array {4×4 double} {4×4 double} {4×1 double} {1×4 double} score1 = 2 score2 = 2

Output argument "win" (and maybe others) not assigned during call to "connect_four". Error in Test2 (line 7) assert(isequal(connect_four(x),0))

3   Fail
x = [2 2 1 1 2 1 2 1 2 2 1 1 1 1 1 2 1 1 1 2 2 2 1 2 2 2 1 1 1 1 2 1 2 1 2 2 1 1 2 2 2 2 1 1 2 1 2 1 2]; assert(isequal(connect_four(x),1))

p = 1×1 cell array {4×4 double} p = 1×2 cell array {4×4 double} {4×4 double} p = 1×3 cell array {4×4 double} {4×4 double} {4×1 double} p = 1×4 cell array {4×4 double} {4×4 double} {4×1 double} {1×4 double} score1 = 4 score2 = 4

Output argument "win" (and maybe others) not assigned during call to "connect_four". Error in Test3 (line 8) assert(isequal(connect_four(x),1))

4   Fail
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]; assert(isequal(connect_four(x),2))

p = 1×1 cell array {4×4 double} p = 1×2 cell array {4×4 double} {4×4 double} p = 1×3 cell array {4×4 double} {4×4 double} {4×1 double} p = 1×4 cell array {4×4 double} {4×4 double} {4×1 double} {1×4 double} score1 = 4 score2 = 4

Output argument "win" (and maybe others) not assigned during call to "connect_four". Error in Test4 (line 8) assert(isequal(connect_four(x),2))

5   Fail
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(x),0))

p = 1×1 cell array {4×4 double} p = 1×2 cell array {4×4 double} {4×4 double} p = 1×3 cell array {4×4 double} {4×4 double} {4×1 double} p = 1×4 cell array {4×4 double} {4×4 double} {4×1 double} {1×4 double} score1 = 7 score2 = 7

Output argument "win" (and maybe others) not assigned during call to "connect_four". Error in Test5 (line 9) assert(isequal(connect_four(x),0))

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!