Last active
March 9, 2017 14:42
-
-
Save deque-blog/bcec439320b8c1ea0206a675239980f5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defn all-transitions | |
[board] | |
(let [aboard (board/board->array board)] ;; Convert to JS array | |
(transduce | |
(mapcat #(available-jumps-at aboard %)) ;; Compute jumps at a given position | |
(group-by-reducer :winner :destination) ;; Group by jump winner and destination | |
board/coordinates))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment