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
using System; | |
using System.Linq; | |
class Program { | |
static void Main() { | |
var r = Enumerable.Range(1, 100); | |
var fizz = r.Select(i => i % 3 == 0 ? "Fizz" : ""); | |
var buzz = r.Select(i => i % 5 == 0 ? "Buzz" : ""); | |
var num = r.Select(i => i % 3 != 0 && i % 5 != 0 ? ""+i : ""); | |
var fizzbuzz = fizz.Zip(buzz, (f, b) => f + b).Zip(num, (fb, n) => fb + n); | |
foreach (var fb in fizzbuzz) { |
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
using System; | |
using System.Linq; | |
class Program { | |
static void Main() { | |
var r = Enumerable.Range(1, 100); | |
var fizz = r.Select(i => i % 3 == 0); | |
var buzz = r.Select(i => i % 5 == 0); | |
int n = 0; | |
var fizzbuzz = fizz.Zip(buzz, (f, b) => { | |
++n; |
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
using System; | |
using System.Linq; | |
class Program { | |
static void Main() { | |
var fz = fizzbuzz(); | |
foreach (var i in Enumerable.Range(1, 100)) { | |
Console.WriteLine(fz()); | |
} | |
} | |
static Func<object> fizzbuzz() { |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
class Program { | |
static void Main(string[] args) { | |
foreach (var s in fizzbuzz(100)) { | |
Console.Write(s); | |
} | |
} | |
private static IEnumerable<object> fizzbuzz(int num) { |
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
using System; | |
using System.Linq; | |
class Program { | |
static void Main() { | |
foreach (var i in Enumerable.Range(1, 100)) { | |
var s = ""; | |
if (i % 3 == 0) s += "Fizz"; | |
if (i % 5 == 0) s += "Buzz"; | |
if (s == "") s += i; | |
Console.WriteLine(s); |
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
using System; | |
using System.Linq; | |
class Program { | |
static void Main(string[] args) { | |
foreach (var i in Enumerable.Range(1, 100)) { | |
Console.WriteLine( | |
i % 3 == 0 && i % 5 == 0 ? "FizzBuzz" : | |
i % 3 == 0 ? "Fizz" : | |
i % 5 == 0 ? "Buzz" | |
: ""+i |
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
using System; | |
using System.Linq; | |
namespace FB0329 { | |
class Program { | |
static void Main(string[] args) { | |
Func<int, bool> fizz = x => x % 3 == 0, buzz = x => x % 5 == 0; | |
Action<object> cw = x => Console.WriteLine(x.ToString()); | |
foreach (var i in Enumerable.Range(1, 100)) { | |
if (fizz(i) && buzz(i)) cw("FizzBuzz"); | |
else if (fizz(i)) cw("Fizz"); |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<gdipp> | |
<version>0.9.1</version> | |
<gdimm> | |
<process> | |
<freetype> | |
<cache_max_faces>8</cache_max_faces> | |
<cache_max_sizes>16</cache_max_sizes> | |
<cache_max_bytes>1048576</cache_max_bytes> |
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
using System; | |
class Program { | |
static void Main(string[] args) { | |
for (int i = 1; i < 100; i++) { | |
if (i % 3 == 0 && i % 5 == 0) Console.WriteLine("FizzBuzz"); | |
else if (i % 3 == 0) Console.WriteLine("Fizz"); | |
else if (i % 5 == 0) Console.WriteLine("Buzz"); | |
else Console.WriteLine(i); | |
} | |
} |
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
using System; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication5 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
NewerOlder