Skip to content

Instantly share code, notes, and snippets.

@aiya000
Created June 18, 2016 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aiya000/0721b6d18aa5ffdd6c4cf6ae93060ca5 to your computer and use it in GitHub Desktop.
Save aiya000/0721b6d18aa5ffdd6c4cf6ae93060ca5 to your computer and use it in GitHub Desktop.
using System;
public class Program {
public static void Main(string[] args) {
var q = new ZuQueue();
for (;;) {
var newFace = q.Next();
Console.Write(newFace);
if (q.IsSucceed()) {
Console.WriteLine("キ・ヨ・シ!");
break;
}
}
}
}
class ZunGenerator {
private static Random random = new Random();
private static string[] samples = new [] { "ズン", "ドコ" };
public static string Generate() {
return samples[random.Next(0, 2)];
}
}
class ZuQueue {
private Tuple<string,string,string,string,string> result = Tuple.Create("", "", "", "", "");
public bool IsSucceed() {
var _1 = this.result.Item1;
var _2 = this.result.Item2;
var _3 = this.result.Item3;
var _4 = this.result.Item4;
var _5 = this.result.Item5;
return _1 == "ズン" &&
_2 == "ズン" &&
_3 == "ズン" &&
_4 == "ズン" &&
_5 == "ドコ";
}
public string Next() {
var _2 = this.result.Item2;
var _3 = this.result.Item3;
var _4 = this.result.Item4;
var _5 = this.result.Item5;
var newFace = ZunGenerator.Generate();
this.result = Tuple.Create(_2, _3, _4, _5, newFace);
return newFace;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment