Skip to content

Commit

Permalink
Tidying up code
Browse files Browse the repository at this point in the history
  • Loading branch information
calebpagel committed Aug 15, 2013
1 parent 05ae015 commit b3eddfe
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions calebpagel+clojure/fizzbuzz.clj
Expand Up @@ -5,23 +5,15 @@
;; Comments welcome




(def buzz (fn [x] (= (mod x 5) 0)))



(def fizz (fn [x] (= (mod x 3) 0)))




(def fizzbuzzer (fn [x] (if (and (fizz x) (buzz x)) "FIZZBUZZ"
(if (fizz x) "FIZZ"

(if (buzz x) "BUZZ"
(if (buzz x) "BUZZ"
x)))))



(dotimes [n 100] (println n "is" (fizzbuzzer n)))
(dotimes [n 100] (println n "is" (fizzbuzzer n)))

0 comments on commit b3eddfe

Please sign in to comment.