Skip to content

FizzBuzz

editable example

Click the pencil to open this in an editor, change it, and run it in your browser. The same solution is posted on Rosetta Code.

ghul
use IO.Std.write_line
for i in 1::100 do
write_line(
if i % 15 == 0 then
"FizzBuzz"
elif i % 3 == 0 then
"Fizz"
elif i % 5 == 0 then
"Buzz"
else
"{i}"
fi
)
od