Skip to content

Instantly share code, notes, and snippets.

@llasram
Forked from anonymous/gist:1af8da56680808458d7d
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save llasram/91eb3e13c66062fc7585 to your computer and use it in GitHub Desktop.
Save llasram/91eb3e13c66062fc7585 to your computer and use it in GitHub Desktop.
(ns my-stuff.core
(:require [clojure.string :as str]))
(defn anagram?
[word word']
(let [letter? #(Character/isLetter %)
letters #(->> % str/lower-case (filter letter?) set)]
(= (letters word) (letters word'))))
(defn -main
[& args]
(if (not= (count args) 2)
(println "Usage: <first word> <second word>")
(if (anagram? (first args) (second args))
(println "Anagram")
(println "Not an anagram"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment