Skip to contents

Displays the dealer’s hand and score, followed by each player's hand, score, and result. This function is called automatically when printing objects of class blackjack_game.

Usage

# S3 method for class 'blackjack_game'
print(x, ...)

Arguments

x

An object of class blackjack_game returned by simulate_blackjack_game.

...

Additional arguments passed to internal print methods (not used).

Value

Invisibly returns the original blackjack_game object.

Details

This method provides a clean summary of a simulated game round. It is especially helpful for quick inspection when calling a game object in the console.

Examples

game <- simulate_blackjack_game(num_players = 2, seed = 42)
print(game)
#> Dealer's hand:  J♣ Q♦ 
#> Dealer's score:  20 
#> 
#> Player 1 hand: 2♠ K♥ 6♥
#> Player 1 score: 18
#> Player 1 result: Dealer wins!
#> 
#> Player 2 hand: J♠ J♦
#> Player 2 score: 20
#> Player 2 result: Tie!
#>