3 ms·
You're right about the order part and I didn't consider it initially. This is what Fizzbuzz looks like in Clojure: (defn fizzbuzz [n] (cond (zero?
by alabhyajindal 2y ago
You're right about the order part and I didn't consider it initially. This is what Fizzbuzz looks like in Clojure:
(defn fizzbuzz [n]
(cond
(zero? (rem n 15)) "FizzBuzz"
(zero? (rem n 3)) "Fizz"
(zero? (rem n 5)) "Buzz"
:else (str n)))
(defn print-fizzbuzz [n]
(doseq [i (range 1 (inc n))]
(println (fizzbuzz i))))
This looks overwhelming for someone who hasn't written any Lisp. My thought looking at this code was that I have to type a parenthesis before formulating any thought. Which is crazy because it's not some huge thing. It's like saying I have to press Enter before writing a line of Python.