mirror of
https://github.com/janet-lang/janet
synced 2025-10-08 04:22:27 +00:00
Rename to janet
This commit is contained in:
13
examples/fizzbuzz.janet
Normal file
13
examples/fizzbuzz.janet
Normal file
@@ -0,0 +1,13 @@
|
||||
# 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)))))
|
Reference in New Issue
Block a user