Skip to content

Instantly share code, notes, and snippets.

@DavidArno
Created October 17, 2017 12:23
Show Gist options
  • Save DavidArno/8191382afb36af1697db8ce1b0b30bdd to your computer and use it in GitHub Desktop.
Save DavidArno/8191382afb36af1697db8ce1b0b30bdd to your computer and use it in GitHub Desktop.
FizzBuzz using SuccincT
IEnumerable<string> GenerateFizzBuzzList()
{
    var fizzes = Cycle("", "", "Fizz");
    var buzzes = Cycle("", "", "", "", "Buzz");
    var words = fizzes.Zip(buzzes, (f, b) => f + b);
    var numbers = Range(1, 100);
    return numbers.Zip(words, (n, w) => w == "" ? n.ToString() : w);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment