Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/FizzBuzz/Clojure/fizzbuzz-12.clj
Normal file
19
Task/FizzBuzz/Clojure/fizzbuzz-12.clj
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
;;Using clojure maps
|
||||
(defn fizzbuzz
|
||||
[n]
|
||||
(let [rule {3 "Fizz"
|
||||
5 "Buzz"}
|
||||
divs (->> rule
|
||||
(map first)
|
||||
sort
|
||||
(filter (comp (partial = 0)
|
||||
(partial rem n))))]
|
||||
(if (empty? divs)
|
||||
(str n)
|
||||
(->> divs
|
||||
(map rule)
|
||||
(apply str)))))
|
||||
|
||||
(defn allfizzbuzz
|
||||
[max]
|
||||
(map fizzbuzz (range 1 (inc max))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue