diff --git a/71_Poker/csharp/Game.cs b/71_Poker/csharp/Game.cs index 7bc3d0bb..4d363253 100644 --- a/71_Poker/csharp/Game.cs +++ b/71_Poker/csharp/Game.cs @@ -31,7 +31,7 @@ internal class Game do { PlayHand(table); - } while (!table.IsGameOver()); + } while (table.ShouldPlayAnotherHand()); } internal void PlayHand(Table table) diff --git a/71_Poker/csharp/Players/Human.cs b/71_Poker/csharp/Players/Human.cs index f7b4cfb2..cf42413e 100644 --- a/71_Poker/csharp/Players/Human.cs +++ b/71_Poker/csharp/Players/Human.cs @@ -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; } diff --git a/71_Poker/csharp/Table.cs b/71_Poker/csharp/Table.cs index 925e0469..0bafb775 100644 --- a/71_Poker/csharp/Table.cs +++ b/71_Poker/csharp/Table.cs @@ -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"); } } \ No newline at end of file