Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active March 9, 2017 14:42
Show Gist options
  • Save deque-blog/bcec439320b8c1ea0206a675239980f5 to your computer and use it in GitHub Desktop.
Save deque-blog/bcec439320b8c1ea0206a675239980f5 to your computer and use it in GitHub Desktop.
(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