Problem 3033. Tic-Tac-Logic - Solution Checker
Tic-Tac-Logic is a logic puzzle wherein a rectangular grid containing a certain set of pre-filled squares must be filled in completely to have no more than two consecutive X's or O's in any row or column. Also, the number of X's and O's must be the same in every row and column (equal to half the size of the row or column). Finally, all rows must be unique (compared to other rows) and all columns must be unique (compared to other columns).
An example puzzle from Conceptis is included here, wherein the first board represents the starting condition and the second board represents a properly solved board:
You will be provided with a variety of completed boards. X's are represented by ones and O's by zeros. Write a function to test whether the board has been properly solved. Remember to check against all three criteria.
Solution Stats
Problem Comments
-
6 Comments
I like the conceptis puzzles. I even implemented a solver in matlab for the Pic-A-Pix a long time ago. Not sure what happened to the code. At the moment, my favorite are the Slitherlink puzzles.
Conceptis does a good job with their site; I especially like the free weekly puzzles. They added a skyscrapers puzzle in the recent past, and someone has posted that problem to Cody, in case you weren't aware: http://www.mathworks.com/matlabcentral/cody/problems/2026-skyscrapers-puzzle. Also, you might want to find that code again, if you haven't already solved the two logic-art problems that have been posted: http://www.mathworks.com/matlabcentral/cody/problems/1700-solve-the-picross-easy and http://www.mathworks.com/matlabcentral/cody/problems/1701-solve-the-picross-hard.
Also, I'd like to see you post a slitherlink puzzle for solving or checking solutions. I'm not quite sure how to implement it, given the interposing matrices that the clues and slithering line would require.
Good explanations + Good tests = Good Problem.
The only thing I'd add to the problem description is that while all rows must be unique, and all columns must be unique, a row can equal a column and the matrix can still be "solved." Other than that, good problem.
Thanks, James and Jean-Marie. Your likes mean a lot. Also, I updated the description to specify rows are unique amongst rows and columns are unique among columns.
Solution Comments
Show commentsProblem Recent Solvers28
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
2971 Solvers
-
647 Solvers
-
585 Solvers
-
The Answer to Life, the Universe, and Everything
525 Solvers
-
Convert a Cell Array into an Array
1706 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!