Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created March 8, 2017 23:34
Show Gist options
  • Save deque-blog/843ca73f0a161d52a0895668e7cf29eb to your computer and use it in GitHub Desktop.
Save deque-blog/843ca73f0a161d52a0895668e7cf29eb to your computer and use it in GitHub Desktop.
(defn- ^boolean empty-cell?
[board [x y]]
(= :none (aget board x y)))
(defn- available-jumps-at
"Provides the list of jumps that can be done at a given `jump-destination`"
[board jump-destination]
(if (empty-cell? board jump-destination)
(eduction
(keep #(seek-jump-source-toward board jump-destination %))
cst/directions)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment