static void Main(string[] args) { HanoiGame game = new HanoiGame(); game.Setup(); game.Play(); Console.ReadKey(); }
#pragma warning disable IDE0060 // 移除未使用的參數 static void Main(string[] args) #pragma warning restore IDE0060 // 移除未使用的參數 { HanoiGame game = new HanoiGame(); game.Setup(); game.Play(); Console.ReadKey(); }
static void Main(string[] args) { IGame game = null; Console.WriteLine("想玩塔1想玩猜2"); string input = Console.ReadLine(); int re; int.TryParse(input, out re); switch (re) { case 1: game = new HanoiGame(); break; case 2: game = new GuessGame(); break; } game.Setup(); game.Play(); }