Skip to content

Instantly share code, notes, and snippets.

Created February 7, 2014 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1af8da56680808458d7d to your computer and use it in GitHub Desktop.
Save anonymous/1af8da56680808458d7d to your computer and use it in GitHub Desktop.
(ns my-stuff.core
(:gen-class))
(defn isAnagram?
[firstWord secondWord]
(letfn [(clean [word] (apply str (filter #(Character/isLetter %) word)))]
(if (= (sort (clean firstWord)) (sort (clean secondWord)))
(println "Anagram")
(println "Not an anagram"))))
(defn -main
[& args]
(if (= (count args) 2)
(isAnagram? (first args) (second args))
(println "Usage: <first word> <second word>")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment