Created
January 29, 2014 17:09
-
-
Save bsiegel/8692383 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
(ns fizzbuzz.core) | |
(declare fb) | |
(defn -main [] | |
(doseq [i (range 1 101)] | |
(println (fb i)))) | |
(defmulti fb (fn [i] [(= 0 (mod i 3)) (= 0 (mod i 5))])) | |
(defmethod fb [true true] [_] "FizzBuzz") | |
(defmethod fb [true false] [_] "Fizz") | |
(defmethod fb [false true] [_] "Buzz") | |
(defmethod fb :default [i] i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment