Skip to content

Instantly share code, notes, and snippets.

@gomasy
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save gomasy/d544dd4254583237ff2b to your computer and use it in GitHub Desktop.

Select an option

Save gomasy/d544dd4254583237ff2b to your computer and use it in GitHub Desktop.
もっと短く出来ると思う。。。
using System;
using System.Linq;
public class Stap
{
static string stap;
static int i = 0;
static void Main(string[] args)
{
var rnd = new Random();
var arr = Enumerable.Range(65, 26).Select(c => (char)c).ToArray();
while (stap != "STAP")
{
stap = string.Concat(Enumerable.Range(0, 4).Select(n => arr[rnd.Next(arr.Length)]));
Console.Write(stap + "細胞!");
i++;
}
Console.WriteLine("\n\n" + i + "回目で陽性かくにん!\nよかった☆");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment