This solution is outdated. To rescore this solution, sign in.
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
0 -1 0
-1 0 1
ans =
3 3
a_reformed =
1 0 -1 1 0 0 1 -1
0 -1 0 0 -1 0 -1 -1
0 0 1 -1 0 1 1 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
0 1 -1
1 -1 -1
ans =
3 3
a_reformed =
1 0 1 1 0 0 1 1
0 1 -1 0 1 -1 1 1
0 -1 -1 1 -1 -1 -1 0
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 0 0
-1 1 -1
1 -1 0
ans =
3 3
a_reformed =
1 -1 1 1 0 0 1 1
0 1 -1 -1 1 -1 1 1
0 -1 0 1 -1 0 0 0
wins =
7 9
|
Renaming a field in a structure array
731 Solvers
325 Solvers
Matrix which contains the values of an other matrix A at the given locations.
214 Solvers
232 Solvers
413 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!