Last active
November 5, 2015 02:57
-
-
Save amirrajan/6090464af6fac505db1b 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 five-by-five [[:. :. :. :. :.] | |
[:. :. :. :. :.] | |
[:. :. :. :. :.] | |
[:. :. :. :. :.] | |
[:. :. :. :. :.]]) | |
(defn to-coordinates [board] | |
(into [] | |
(flatten | |
(map-indexed | |
(fn [row-pos row] | |
(map-indexed | |
(fn [col-pos piece] | |
{:row-pos row-pos | |
:col-pos col-pos | |
:piece piece}) row)) board)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something like this?
Or, equivalently: