Solution 7 should be correct. The diagonal of -1s is a valid win.
Hope all is well with you, Doug!
@Sean, I think Doug's got it right. He's asking only if the X side (that is +1) is in a winning position. In test 7, the O side (-1) is in a winning position. So the answer given is correct.
Test 7 should return true. There is a diagonal of -1.
No. See Ned's comment and read the problem description again.
Shouldn't Test 7 be y_correct = 1?
To be fair, you didn't mention anything about anti-diagonal in your problem description (test no. 4). Or am I missing something?
Find the sum of the elements in the "second" diagonal
999 Solvers
Make a random, non-repeating vector.
3037 Solvers
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
238 Solvers
Remove element(s) from cell array
390 Solvers
3209 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!