예제 #1
0
        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));
        }
예제 #2
0
        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();
        }
예제 #3
0
        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();
            }
        }