mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-29 14:15:08 -08:00
Move ShouldContinue check
This commit is contained in:
@@ -30,10 +30,14 @@ internal class Game
|
||||
_io.Write(Resource.Streams.Title);
|
||||
_io.Write(Resource.Streams.Instructions);
|
||||
|
||||
do
|
||||
while (true)
|
||||
{
|
||||
deck.Shuffle(_random);
|
||||
} while (PlayHand(table));
|
||||
var gameOver = PlayHand(table);
|
||||
if (gameOver) { break; }
|
||||
|
||||
_io.WriteLine($"Now I have $ {table.Computer.Balance} and you have $ {table.Human.Balance}");
|
||||
if (!_io.ReadYesNo("Do you wish to continue")) { break; }
|
||||
}
|
||||
}
|
||||
|
||||
internal bool PlayHand(Table table)
|
||||
|
||||
@@ -26,6 +26,8 @@ internal class Table
|
||||
|
||||
public void Deal()
|
||||
{
|
||||
Deck.Shuffle();
|
||||
|
||||
Pot = Human.AnteUp() + Computer.AnteUp();
|
||||
|
||||
Human.NewHand();
|
||||
|
||||
Reference in New Issue
Block a user