Problem 58. Tic Tac Toe FTW
Should example Output wins should be [3 4]?
I guess so.
The example should definitely be [3 4]. I can't understand why the no-wins output has to be 0 rather than  - the empty matrix would be more consistent with the requirement to list all squares. I wonder also if the list is supposed to have unique entries? The test cases don't check this.
Test 2: b=7 ?
Sorry. OK. It is X's move
Bad problem. Example solution should be [3 4].
Test suite problem.
The first test calls my function twice, with different values for (a). To test this
y function starts and endes with diagnostics:
function wins = ticTacToe(a)
disp( a )
wins = unique( wins)
The first test result is:
a = [ 1 0 0
0 -1 0
-1 0 1];
b = ;
out = ticTacToe(a);
1 0 1
0 -1 0
-1 -1 1
1 0 0
0 -1 0
-1 0 1
Empty matrix: 0-by-1
I keep getting an error while submitting my solution: "There was an issue submitting your solution. Remove inappropriate content. For guidelines, see About Cody." There is no inappropriate content in my solution.
Brendan, this may be the side effect of anti-spam filters. Try to change variable names, etc. Sometimes even adding a space here or there works.
Brendan, Jan is right. Dealing with spam is giving us a hard time. If we set the barrier too low, we get terrible inflows of spam. If we set it too high, we annoy good people like you. Sorry about the hassle. We are working on it now.
Please fix test case 1. It's somehow creating problems for the other test cases because 'a = [ ' doesn't start on a new line.
I agree with yurenchu. The test cases are broken at the moment and need to be fixed - otherwise correct solutions don't work.
, = ,
'qx' = 'qx'
@yurenchu - I fixed the test case 1 to start in a new line.
Thank you for fixing the test case!
Solution CommentsShow comments
Problem Recent Solvers1522
Project Euler: Problem 5, Smallest multiple
Sum of odd numbers in a matrix
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!