Skip to content

Instantly share code, notes, and snippets.

@naush
Created February 12, 2011 23:38
Show Gist options
  • Save naush/824237 to your computer and use it in GitHub Desktop.
Save naush/824237 to your computer and use it in GitHub Desktop.
(defn find-enemy [board point color size]
(let [color (if (= white color) black white)
neighbors (find-neighbors point size)]
(set (reduce
#(if (ally? %2)
(merge %1 (find-ally board %2 color size))
%1)
() neighbors))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment