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?
Swap the input arguments
Acid and water
Back to basics 23 - Triangular matrix
03 - Matrix Variables 2
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
Getting the absolute index from a matrix
Siblings of a graphics object
Project Euler: Problem 4, Palindromic numbers
Cumulative probability of finding an unlikely combination
Project Euler: Problem 3, Largest prime factor
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office