RosettaCodeData/Task/FizzBuzz/Nemerle/fizzbuzz.nemerle

20 lines
361 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
using System;
using System.Console;
module FizzBuzz
{
FizzBuzz(x : int) : string
{
|x when x % 15 == 0 => "FizzBuzz"
|x when x % 5 == 0 => "Buzz"
|x when x % 3 == 0 => "Fizz"
|_ => $"$x"
}
Main() : void
{
foreach (i in [1 .. 100])
WriteLine($"$(FizzBuzz(i))")
}
}