Blackjack

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

set.seed(101315)

You can play Blackjack against the dealer.

Payouts

Outcome | Multiplier --- | --- Dealer Wins | 0x Player Wins | 2x

Example

library(casino)

# Setup a new casino
setup(".wynn")

# Sit at the blackjack table with default bet of 25
x <- Blackjack$new(who = "Gritty", bet = 25)

# Play a hand
x$play()

x$hit()

x$stand()

# Play another
x$play()

x$stand()

# Play one last hand, and bet it all!
x$play(bet = 100)

x$hit()

x$stand()

# delete records
delete()


Try the casino package in your browser

Any scripts or data that you put into this service are public.

casino documentation built on May 2, 2019, 8:41 a.m.