1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-24 17:27:18 +00:00
janet/examples/fizzbuzz.dst
Calvin Rose 510feeed7f Allow marshaling of more functions for core.
Fix indentation in some files.
2018-08-22 21:41:25 -04:00

14 lines
310 B
Plaintext

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