RosettaCodeData/Task/FizzBuzz/Golo/fizzbuzz.golo
2017-09-25 22:28:19 +02:00

16 lines
308 B
Text

module FizzBuzz
augment java.lang.Integer {
function getFizzAndOrBuzz = |this| -> match {
when this % 15 == 0 then "FizzBuzz"
when this % 3 == 0 then "Fizz"
when this % 5 == 0 then "Buzz"
otherwise this
}
}
function main = |args| {
foreach i in [1..101] {
println(i: getFizzAndOrBuzz())
}
}