Created
May 8, 2017 10:39
-
-
Save jskeet/957f94ef874e9d6813ce3d108b9f2d3a to your computer and use it in GitHub Desktop.
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
public static string FizzBuzz(int n) | |
{ | |
var fizz = Test(3, "fizz"); | |
var buzz = Test(5, "buzz"); | |
return fizz(buzz(x => x))(n.ToString()); | |
Func<Func<string, string>, Func<string, string>> Test(int d, string s) => | |
x => n % d == 0 ? _ => s + x("") : x; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment