mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 15:16:33 -08:00
Fix game loop and finished message
This commit is contained in:
@@ -36,10 +36,15 @@ internal class Game
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (TryBuild(yourBug, m => m.You) || TryBuild(myBug, m => m.I))
|
||||
var partAdded = TryBuild(yourBug, m => m.You);
|
||||
Thread.Sleep(500);
|
||||
_io.WriteLine();
|
||||
partAdded |= TryBuild(myBug, m => m.I);
|
||||
|
||||
if (partAdded)
|
||||
{
|
||||
if (yourBug.IsComplete) { _io.WriteLine(Message.Complete.You); }
|
||||
if (myBug.IsComplete) { _io.WriteLine(Message.Complete.I); }
|
||||
if (yourBug.IsComplete) { _io.WriteLine("Your bug is finished."); }
|
||||
if (myBug.IsComplete) { _io.WriteLine("My bug is finished."); }
|
||||
|
||||
if (!_io.ReadString("Do you want the picture").Equals("no", InvariantCultureIgnoreCase))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user