Last active
March 1, 2017 20:38
-
-
Save deque-blog/fe2ec1188e63de25c4f4d9bf57e2204e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def winning-diags | |
[(filter #(= (first %) (second %)) board/coordinates) | |
(filter #(= (dec board/size) (reduce + %)) board/coordinates)]) | |
(def winning-rows (partition board/size board/coordinates)) | |
(def winning-lines (algo/transpose winning-rows)) | |
(def winning-cell-sets (concat winning-rows winning-lines winning-diags)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment