Skip to content

Instantly share code, notes, and snippets.

@masaru-b-cl
Created February 27, 2014 08:04
Show Gist options
  • Save masaru-b-cl/9246185 to your computer and use it in GitHub Desktop.
Save masaru-b-cl/9246185 to your computer and use it in GitHub Desktop.
semicolonless FizzBuzz
class Program
{
static void Main(string[] args)
{
if (
System.Linq.Enumerable.ToList(
System.Linq.Enumerable.Select(
System.Linq.Enumerable.Range(1, 100),
n =>
n % 3 == 0 && n % 5 == 0 ? "FizzBuzz" :
n % 3 == 0 ? "Fizz" :
n % 5 == 0 ? "Buzz" :
n.ToString()
)
).ForEach(System.Console.WriteLine) is object) { }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment