Created
October 17, 2017 12:23
-
-
Save DavidArno/8191382afb36af1697db8ce1b0b30bdd to your computer and use it in GitHub Desktop.
FizzBuzz using SuccincT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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