more double-down fixes
This commit is contained in:
parent
83aa05a611
commit
5b62addaaa
2 changed files with 23 additions and 9 deletions
15
src/game.rs
15
src/game.rs
|
|
@ -173,14 +173,17 @@ impl Game {
|
|||
|
||||
// if player busts, immediately lose bet
|
||||
if player_hand.value() > 21 {
|
||||
return EndState::new(
|
||||
PlayResult::Bust,
|
||||
dealer_hand.cards(),
|
||||
player_hand.cards(),
|
||||
shuffled,
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if player_hand.value() > 21 {
|
||||
return EndState::new(
|
||||
PlayResult::Bust,
|
||||
dealer_hand.cards(),
|
||||
player_hand.cards(),
|
||||
shuffled,
|
||||
);
|
||||
}
|
||||
|
||||
// Dealer turn
|
||||
while dealer_hand.value() < 17 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue