Cody

# Problem 58. Tic Tac Toe FTW

Solution 442625

Submitted on 14 May 2014 by Pascal Geschwill
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(:)))

row = 2.00 1.00 2.00 col = 1.00 2.00 3.00 wins = 0 4.00 wins = 0 4.00 8.00 wins = 4.00 8.00

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

row = 2.00 1.00 3.00 1.00 2.00 col = 1.00 2.00 2.00 3.00 3.00 wins = 0

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

row = 2.00 1.00 1.00 col = 1.00 2.00 3.00 wins = 2.00 wins = 2.00 0 7.00 wins = 2.00 7.00

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

row = 1.00 1.00 3.00 col = 2.00 3.00 3.00 wins = 0 7.00 wins = 0 7.00 9.00 wins = 7.00 9.00