Just for fun:

// map, join, text, iota, writeln, tuple import std.algorithm, std.array, std.conv, std.range, std.stdio, std.typecons;

void main()
{
  iota(1,100)
  .map!(a => tuple(a, a % 3 == 0 ? 0 : 4, a % 5 == 0 ? 8 : 4))
  .map!(a => a[1] == a[2] ? a[0].text : "fizzbuzz"[a[1] .. a[2]])
  .join(", ")
  .writeln;
}

Reply via email to