mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-29 14:15:08 -08:00
Add a bailout
Forcing a SIGKILL is bad form, give some UI for playing again or bailing.
This commit is contained in:
@@ -45,9 +45,18 @@ namespace hurkle
|
||||
{
|
||||
hurkle.PlayGame();
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("LET'S PLAY AGAIN. HURKLE IS HIDING");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("PLAY AGAIN? (Y)ES/(N)O");
|
||||
var playAgainResponse = Console.ReadLine();
|
||||
if(playAgainResponse.Trim().StartsWith("y", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("LET'S PLAY AGAIN. HURKLE IS HIDING");
|
||||
Console.WriteLine();
|
||||
}else{
|
||||
Console.WriteLine("THANKS FOR PLAYING!");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user