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.Globalization; | |
using System.Linq; | |
using System.Text; | |
namespace FizzBuzzKata | |
{ | |
public class Program | |
{ |
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 c=System.Console; | |
class P | |
{ | |
static void Main() | |
{for(int i=1;i<101;i++)c.WriteLine(i%15==0?"FizzBuzz":i%5==0?"Buzz":i%3==0?"Fizz":i+"");c.ReadKey();} | |
} |
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; | |
namespace FizzBuzzNoSelection | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
for (int i = 1; i <= 100; 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; | |
namespace FizzBuzzCustomNumericFormatter | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
const string format = "{0:#;}{1:;;Fizz}{2:;;Buzz}"; |
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 FizzBuzzCollapsedStringArray | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
Enumerable.Range(1, 100).Select(i => string.Join(string.Empty, new[] |
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 class ActiveDirectoryService | |
{ | |
private const string GroupNotFoundMessage = "The directory group, '{0}', could not be found."; | |
private const string UserNotFoundMessage = "The user account, '{0}', could not be found "; | |
private readonly string _adDomain; | |
public ActiveDirectoryService(string domain) | |
{ | |
_adDomain = domain; |
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 class ActiveDirectoryService | |
{ | |
private const string GroupNotFoundMessage = "The directory group, '{0}', could not be found."; | |
private const string UserNotFoundMessage = "The user account, '{0}', could not be found "; | |
private readonly string _adDomain; | |
public ActiveDirectoryService(string domain) | |
{ | |
_adDomain = domain; |
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; | |
using FizzBuzzMap = System.Func<int, string>; | |
namespace FizzBuzz | |
{ | |
public class Program | |
{ | |
public static void Main() |
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
# receive an array of ints, compact it, order the elements, and group them into ranges | |
# original: | |
def get_ranges_in(values_array) | |
return [] if values_array.nil? | |
values_array.compact.sort.uniq.inject([]) do |r,x| | |
r.empty? || r.last.last.succ != x ? r << (x..x) : r[0..-2] << (r.last.first..x) | |
end |
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
{evens, odds} = (1..10) |> Enum.partition(fn(x) -> Integer.is_even(x) end) |
OlderNewer