Problem 90. Connect Four Win Checker
Solution Stats
Problem Comments
Solution Comments
-
1 Comment
Padded with 0's in convolution kernel to avoid collisions
-
1 Comment
Wow, using a string really cuts down on solution size.
-
3 Comments
Can someone please tell me whats going on?!
The reshape function creates a matrix with the vector [1 3 9 27] placed vertically, horizontally, and diagonally; the conv2 function does sort of a dot product of these with all sets of four elements in the test matrix; if [1 1 1 1] or [2 2 2 2] appears, the result will be 40 or 80, respectively.
Impressive code compression
-
1 Comment
This code is referenced in the following blog post: http://blogs.mathworks.com/community/2015/01/19/robot-game-playing-in-matlab-part-2/
Problem Recent Solvers954
Suggested Problems
-
Get the area codes from a list of phone numbers
925 Solvers
-
Back to basics 17 - white space
267 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
8207 Solvers
-
933 Solvers
-
Calculate Amount of Cake Frosting
18373 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!