mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-17 07:22:04 -08:00
Fix hand comparison text
This commit is contained in:
@@ -31,7 +31,7 @@ internal class Game
|
||||
do
|
||||
{
|
||||
PlayHand(table);
|
||||
} while (!table.IsGameOver());
|
||||
} while (table.ShouldPlayAnotherHand());
|
||||
}
|
||||
|
||||
internal void PlayHand(Table table)
|
||||
|
||||
@@ -40,7 +40,6 @@ internal class Human : Player
|
||||
// The original program had some code about selling a tie tack, but due to a fault
|
||||
// in the logic the code was unreachable. I've omitted it in this port.
|
||||
|
||||
_io.WriteLine("Your wad is shot. So long, sucker!");
|
||||
IsBroke = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +88,8 @@ internal class Table
|
||||
_io.WriteLine("My hand:");
|
||||
_io.Write(Computer.Hand);
|
||||
_io.WriteLine();
|
||||
_io.Write($"You have {Human.Hand.Name}");
|
||||
_io.Write($"and I have {Computer.Hand.Name}");
|
||||
_io.WriteLine($"You have {Human.Hand.Name}");
|
||||
_io.WriteLine($"and I have {Computer.Hand.Name}");
|
||||
if (Computer.Hand > Human.Hand) { return Computer; }
|
||||
if (Human.Hand > Computer.Hand) { return Human; }
|
||||
_io.WriteLine("The hand is drawn.");
|
||||
@@ -97,7 +97,7 @@ internal class Table
|
||||
return null;
|
||||
}
|
||||
|
||||
internal bool IsGameOver()
|
||||
internal bool ShouldPlayAnotherHand()
|
||||
{
|
||||
if (Computer.IsBroke)
|
||||
{
|
||||
@@ -112,6 +112,6 @@ internal class Table
|
||||
}
|
||||
|
||||
_io.WriteLine($"Now I have $ {Computer.Balance} and you have $ {Human.Balance}");
|
||||
return !_io.ReadYesNo("Do you wish to continue");
|
||||
return _io.ReadYesNo("Do you wish to continue");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user