1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-17 06:04:49 +00:00
janet/lib/fizzbuzz.dst
2018-03-13 16:40:56 -04:00

14 lines
263 B
Plaintext

# A simple fizz buzz example
(defn fizzbuzz
"Prints the fizzbuzz problem."
[]
(for [i 1 101]
(let [fizz (zero? (% i 3))
buzz (zero? (% i 5))]
(print (cond
(and fizz buzz) "fizzbuzz"
fizz "fizz"
buzz "buzz"
i)))))