Problem 44363. Is this is a Tic Tac Toe X Win?
For this game:
We would store the state as this:
-1 1 1
1 -1 -1
1 -1 -1
If there were any blanks squares, they would be 0;
For this challenge, given a game state, does X (1) have a three in a row on any row, column or major diagonal?
Solution Stats
Problem Comments
-
2 Comments
Sean de Wolski
on 17 Oct 2017
Solution 7 should be correct. The diagonal of -1s is a valid win.
Hope all is well with you, Doug!
Ned Gulley
on 17 Oct 2017
@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.
Solution Comments
Show commentsGroup

Cody5:Easy
- 31 Problems
- 159 Finishers
- Energy of a photon
- Breaking Out of the Matrix
- The Top 5 Primes
- I Plead the Fifth
- Pentagonal Numbers
- Is this is a Tic Tac Toe X Win?
- Inscribed Pentagon?
- Circle/Pentagon Overlap
- Octoberfest festival
- Polarisation
- Missing five
- ASCII Birthday Cake
- Find the nearest prime number
- Extra safe primes
- 5 Prime Numbers
- Is this is a Tic Tac Toe X Win?
- Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
- MATLAB Counter
- Basic electricity in a dry situation
- How to subtract?
- Pernicious Anniversary Problem
- 5 Prime Numbers
- Is it really a 5?
- The glass half full
- Pi Digit Probability
- A Simple Tide Gauge with MATLAB
- Predicting life and death of a memory-less light bulb
- Write c^3 as sum of two squares a^2+b^2
- Van Eck's Sequence's nth member
- Sums of Multiple Pairs of Triangular Numbers
- Recaman Sequence - I
- Recaman Sequence - II
- Spot the First Occurrence of 5
- Energy of a photon
Problem Recent Solvers513
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!