Ejemplo n.º 1
0
 private static void RunLoop(Calculator calculator)
 {
     while (true)
     {
         Console.ForegroundColor = ConsoleColor.Gray;
         var line = Console.ReadLine();
         if (line == null) break;
         var args = SplitInput(line);
         var result = calculator.Calculate(args);
         Console.ForegroundColor = result.HasValue ? ConsoleColor.Green : ConsoleColor.Red;
         Console.WriteLine("> " + result);
     }
 }