static void Main(string[] args) { ConsoleKey key; do { Console.Clear(); key = Menu(); switch (key) { case ConsoleKey.NumPad1: case ConsoleKey.D1: Homework2.Task1(); break; case ConsoleKey.NumPad2: case ConsoleKey.D2: Homework2.Task2(); break; case ConsoleKey.NumPad3: case ConsoleKey.D3: Homework2.Task3(); break; case ConsoleKey.NumPad4: case ConsoleKey.D4: Homework2.Task4(); break; case ConsoleKey.NumPad5: case ConsoleKey.D5: Homework2.Task5(); break; case ConsoleKey.Escape: Console.WriteLine("Bye-bye"); break; default: Console.WriteLine("Wrong!"); break; } Console.ReadLine(); }while (key != ConsoleKey.Escape); }
static void Main() { using (var game = new Homework2()) game.Run(); }