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); }
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()); }