Files
monkey/examples/fizzbuzz.monkey
Chuck Smith 138df71cc8
Some checks failed
Publish Image / publish (push) Waiting to run
Test / build (push) Waiting to run
Build / build (push) Has been cancelled
build changes
2024-03-28 15:11:47 -04:00

19 lines
269 B
Plaintext

#!/usr/bin/env monkey-lang
test := fn(n) {
if (n % 15 == 0) {
return "FizzBuzz"
} else if (n % 5 == 0) {
return "Buzz"
} else if (n % 3 == 0) {
return "Fizz"
} else {
return str(n)
}
}
n := 1
while (n <= 100) {
print(test(n))
n = n + 1
}