Cody

Solution 2024671

Submitted on 17 Nov 2019 at 3:34
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
a = [ 1 0 1 0 -1 0 -1 -1 1]; b = [4 8]; out = ticTacToe(a); assert(isequal(out(:), b(:)))

2   Fail
a = [ 1 0 0 0 -1 0 -1 0 1]; b = [0]; out = ticTacToe(a); assert(isequal(out(:), b(:)))

Assertion failed.

3   Fail
a = [ 1 0 0 0 1 -1 1 -1 -1]; b = [2 7]; out = ticTacToe(a); assert(isequal(out(:), b(:)))

Index exceeds the number of array elements (1). Error in ticTacToe (line 49) wins(i) = (curr(2)-1)*m+curr(1); Error in Test3 (line 6) out = ticTacToe(a);

4   Fail
a = [ 1 0 0 -1 1 -1 1 -1 0]; b = [7 9]; out = ticTacToe(a); assert(isequal(out(:), b(:)))

Index exceeds the number of array elements (1). Error in ticTacToe (line 49) wins(i) = (curr(2)-1)*m+curr(1); Error in Test4 (line 6) out = ticTacToe(a);