Skip to content

Instantly share code, notes, and snippets.

@n-yoda
Created June 4, 2014 17:34
Show Gist options
  • Save n-yoda/e4a20c6dd891dca08879 to your computer and use it in GitHub Desktop.
Save n-yoda/e4a20c6dd891dca08879 to your computer and use it in GitHub Desktop.
STAP細胞
using System;
using System.Collections.Generic;
using System.Linq;
public class FindStap
{
public static void Main()
{
var rand = new Random();
var inf = Enumerable.Repeat("", 1);
inf = inf
.SelectMany(_ => Enumerable.Repeat("", 1).Concat(inf))
.Select(_ => "AAAA".Select(a => (char)(a + rand.Next(26))))
.TakeWhile(x => !x.SequenceEqual("STAP"))
.Select(x => new String(x.Concat("細胞").ToArray()))
.Concat(new[]{ "STAP細胞", "陽性確認!" });
foreach (var str in inf)
{
Console.WriteLine(str);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment