Test  Status  Code Input and Output 

1  Pass 
x = [1 1 0
0 0 0
0 0 0];
y_correct = 0;
assert(isequal(isLegalTicTacToeState(x),y_correct))
a =
2
b =
0
y =
0

2  Pass 
x = [0 0 0
0 0 0
0 0 0];
y_correct = 1;
assert(isequal(isLegalTicTacToeState(x),y_correct))
a =
0
b =
0
y =
1
a =
0 0 0

3  Pass 
x = [ 1 1 1
1 1 1
1 1 1];
y_correct = 0;
assert(isequal(isLegalTicTacToeState(x),y_correct))
a =
4
b =
5
y =
0

4  Pass 
x = [ 0 1 1
1 1 0
1 0 0];
y_correct = 1;
assert(isequal(isLegalTicTacToeState(x),y_correct))
a =
3
b =
2
y =
1
a =
0 0 1

5  Pass 
x = [ 1 1 1
1 1 1
0 0 0];
y_correct = 0;
assert(isequal(isLegalTicTacToeState(x),y_correct))
a =
3
b =
3
y =
1
a =
0 0 0

6  Pass 
x = [1 1 1
0 1 1
1 0 1];
y_correct = 0;
assert(isequal(isLegalTicTacToeState(x),y_correct))
a =
4
b =
3
y =
1
a =
0 0 1

7  Pass 
x = [1 1 0
0 0 0
0 0 0];
y_correct = 1;
assert(isequal(isLegalTicTacToeState(x),y_correct))
a =
1
b =
1
y =
1
a =
1 1 0

8  Pass 
x = [1 0 0
0 0 0
0 0 0];
y_correct = 0;
assert(isequal(isLegalTicTacToeState(x),y_correct))
a =
0
b =
1
y =
0

9  Pass 
x = [1 1 0
0 1 0
0 1 0];
y_correct = 0;
assert(isequal(isLegalTicTacToeState(x),y_correct))
a =
3
b =
1
y =
0

10  Pass 
x = [1 1 1
1 1 1
1 1 1];
y_correct = 1;
assert(isequal(isLegalTicTacToeState(x),y_correct))
a =
5
b =
4
y =
1
a =
1 3 1

Read a column of numbers and interpolate missing data
1235 Solvers
235 Solvers
325 Solvers
Flag largest magnitude swings as they occur
582 Solvers
404 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!