Ejemplo n.º 1
0
        private static void TestRun()
        {
            Console.WriteLine("Test Run...");
            var pancakeManager = new PancakeRunner();
            var result         = pancakeManager.Process(new PancakeRun(1, "---+-++-", 3));

            Console.WriteLine("Result for [---+-++- 3] is {0}", result.ResultText);

            result = pancakeManager.Process(new PancakeRun(1, "+++++", 4));
            Console.WriteLine("Result for [+++++ 4] is {0}", result.ResultText);

            result = pancakeManager.Process(new PancakeRun(1, "-+-+-", 4));
            Console.WriteLine("Result for [-+-+- 4] is {0}", result.ResultText);
        }
Ejemplo n.º 2
0
        public PancakeResult[] Run(PancakeRun[] runs, Action <string> logResult)
        {
            var runner = new PancakeRunner();

            return(runs.Select(run =>
            {
                var result = runner.Process(run);
                logResult?.Invoke($"#{result.Run.Number}: [{result.Run.Data} {result.Run.FlipperSize}] ...  {result.ResultText}");

                return result;
            }).ToArray());
        }