First commit of partial RosettaCode contents.
Pushing this for testing purposes. Lots of work still needed.
This commit is contained in:
commit
1e05ecd7ee
781 changed files with 9080 additions and 0 deletions
13
Task/FizzBuzz/Clojure/fizzbuzz-4.clj
Normal file
13
Task/FizzBuzz/Clojure/fizzbuzz-4.clj
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(defn fizz-buzz
|
||||
([] (fizz-buzz (range 1 101)))
|
||||
([lst]
|
||||
(letfn [(fizz? [n] (zero? (mod n 3)))
|
||||
(buzz? [n] (zero? (mod n 5)))]
|
||||
(let [f "Fizz"
|
||||
b "Buzz"
|
||||
items (map (fn [n]
|
||||
(cond (and (fizz? n) (buzz? n)) (str f b)
|
||||
(fizz? n) f
|
||||
(buzz? n) b
|
||||
:else n))
|
||||
lst)] items))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue