Dealer's play logic according to Blackjack rules
dealer_play.RdDealer draws cards until reaching at least 17, or hitting 5 cards without busting.
Examples
# Basic example
set.seed(123)
deck <- create_board(1)
dealer_hand <- c("A♠", "6♦")
result <- dealer_play(dealer_hand, deck)
print(result$dealer_hand) # Should show hand with score >= 17
#> [1] "A♠" "6♦" "8♦" "4♦"
# Dealer hits on soft 17: A♠ + 6♠
deck <- c("5♣", "2♦", "3♥", "K♠", "8♠", "9♣") # sample deck
dealer_hand <- c("A♠", "6♠")
dealer_play(dealer_hand, deck)
#> $dealer_hand
#> [1] "A♠" "6♠" "5♣" "2♦" "3♥"
#>
#> $deck
#> [1] "K♠" "8♠" "9♣"
#>