Blackjack R6 Class

Blackjack

Format

An object of class R6ClassGenerator of length 24.

Examples

set.seed(101315) setup()
#> No records found. #> Storing player records at '/Users/anthony/Documents/casino/docs/reference/.casino'
#> Updating value for environment variable 'CASINO_FILE'.
# sit at the blackjack table x <- Blackjack$new(who = "Player 1", bet = 10)
#> You have no money!
# play a hand x$play()
#> You bet 10; you have 90 left.
#> Player Hand: {8, 2} = 10 #> Dealer Hand: {?, 6} = ? #> Will you `hit()` or `stand()`?
x$hit()
#> Player Hand: {8, 2, 8} = 18 #> Dealer Hand: {?, 6} = ? #> Will you `hit()` or `stand()`?
x$stand()
#> Game over! dealer wins #> You lost -10! #> Now you have 90 in your account.
# play a hand blind w/out drawing x$play()$stand()
#> You bet 10; you have 80 left.
#> Player Hand: {6, K} = 16 #> Dealer Hand: {?, Q} = ? #> Will you `hit()` or `stand()`? #> Game over! dealer bust #> You won 10! #> Now you have 100 in your account.
# clean-up delete()