static void Main(string[] args) { Game game = new Game(); while (true) { game.StartNewGame(); game.Loop(); if (!ConsoleInput.GetBool("Play again? y/n")) { Environment.Exit(0); //iziet no loga break; } Console.ReadLine(); } }
static void Main(string[] args) { // Create a new game, start it and call game loop // Ask if user would like to play another round Game game = new Game(); //new game while (true) { game.StartNewGame(); game.Loop(); Console.Write("Another round?"); string answer = Console.ReadLine().ToLower(); if (answer != "y" && answer != "yes") { break; } } }
static void Main(string[] args) { //create new game, start it and call game loop //ask if user would like to play another round Game Game = new Game(); while (true) { Game.StartNewGame(); Game.Loop(); if (!ConsoleInput.GetBool("Would you like to play another game? ")) { break; } } Console.Read(); }