Problem 44657. Kurosu checker
The game of Kurosu is simple. A square grid contains cells that can be filled with either a 'X' or an 'O', similarly to a tic-tac-toe board. Game rules are as follows:
1. The game is played on a 6x6 board.
2. Each row and each column must contain exactly 3 'X's and 3 'O's.
3. Only 2 'X's or 'O's can be placed consecutively, either in a row or in a column.
4. Diagonals are of no importance.
In this problem, given a completely filled Kurosu board, b, return 'true' if the board complies with game rules or 'false' if it does not. 'X's and 'O's are represented by 1s and 0s, respectively.
Example 1:
b = [1 0 1 0 0 1
1 1 0 1 0 0
0 0 1 0 1 1
0 1 0 1 1 0
1 1 0 1 0 0
0 0 1 0 1 1];
tf = true;
Example 2:
b = [1 0 1 0 1 0
1 1 0 1 0 0
0 1 1 0 0 1
0 1 0 1 1 0
1 0 0 1 0 0
0 0 1 0 1 1];
tf = false;
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers22
Suggested Problems
-
Find the largest value in the 3D matrix
1644 Solvers
-
Combinations without using nchoosek
135 Solvers
-
Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.
159 Solvers
-
Sum of diagonals elements of a matrix
229 Solvers
-
Matrix of almost all zeros, except for main diagonal
189 Solvers
More from this Author45
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!