Last active
August 29, 2015 14:27
-
-
Save uroybd/5978630533c5b4e71353 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
(defn move | |
([dvec direction indx] | |
(cond (= direction :up) (move dvec :swap indx (dec indx)) | |
(= direction :down) (move dvec :swap indx (inc indx)) | |
:else (println "Wrong Number of args"))) | |
([dvec direction indx1 indx2] | |
(if (= direction :swap) | |
(assoc dvec indx2 (nth dvec indx1) indx1 (nth dvec indx2)) | |
(println "Invalid arguments")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment