public static IEnumerable <GameResult> MainRelease(string testName) { var hanabi = new HanabiInteractive(); return(File.ReadLines(@"C:\tests\" + testName + ".in", Encoding.UTF8) .Select(hanabi.MakeTurn) .Where(result => result != null)); }
public static void ReleaseMain() { var hanabi = new HanabiInteractive(); var gameResults = ReadLines().Select(hanabi.MakeTurn).Where(result => result != null); foreach (var result in gameResults) { Console.WriteLine(result); } Console.Out.Flush(); }
public static void MainDebug(string testName) { var hanabi = new HanabiInteractive { Debug = true }; foreach (var command in File.ReadLines(@"C:\tests\" + testName + ".in", Encoding.UTF8)) { Console.WriteLine(command + "\n"); var result = hanabi.MakeTurn(command); if (result != null) { Console.WriteLine($"\n{result} {result.Cause.Message}"); } Console.WriteLine("\n----------------------------------\n"); Console.ReadKey(); } }