Cody

# Problem 58. Tic Tac Toe FTW

Solution 1767687

Submitted on 31 Mar 2019 by Danko Jelen
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 0 0 -1 0 -1 0 1]; b = [0]; out = ticTacToe(a); assert(isequal(out(:), b(:)))

a = 1 0 0 1 -1 0 -1 0 1 a = 1 0 0 0 -1 0 -1 0 1 a = 1 1 0 0 -1 0 -1 0 1 a = 1 0 0 0 -1 0 -1 0 1 a = 1 0 0 0 -1 0 -1 1 1 a = 1 0 0 0 -1 0 -1 0 1 a = 1 0 1 0 -1 0 -1 0 1 a = 1 0 0 0 -1 0 -1 0 1 a = 1 0 0 0 -1 1 -1 0 1 a = 1 0 0 0 -1 0 -1 0 1 b = 0 wins = 0

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

a = 1 0 0 1 1 -1 1 -1 -1 b = 2 a = 1 0 0 0 1 -1 1 -1 -1 a = 1 1 0 0 1 -1 1 -1 -1 a = 1 0 0 0 1 -1 1 -1 -1 a = 1 0 1 0 1 -1 1 -1 -1 b = 2 7 a = 1 0 0 0 1 -1 1 -1 -1 wins = 2 7

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

a = 1 1 0 -1 1 -1 1 -1 0 a = 1 0 0 -1 1 -1 1 -1 0 a = 1 0 1 -1 1 -1 1 -1 0 b = 7 a = 1 0 0 -1 1 -1 1 -1 0 a = 1 0 0 -1 1 -1 1 -1 1 b = 7 9 a = 1 0 0 -1 1 -1 1 -1 0 wins = 7 9

### Community Treasure Hunt

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

Start Hunting!