Poker

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

set.seed(101315)

Variants

There are two poker variants available:

Example

library(casino)

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

5-card Draw

x <- Poker$new(who = "Gritty", type = "draw", bet = 20)

# play one hand
x$play()

x$hold(1, 2, 5)    # hold cards in positions {1, 2, 5}

x$draw()           # draw new cards for positions {3, 4}

5-card Stud

x <- Poker$new(who = "Gritty", type = "stud", bet = 10)

# play one hand
x$play()

# play 2 hands back-to-back
x$play()$play(bet = 5)

Payouts

# get payout table (based on betting 25)
knitr::kable(x$get_payout())
# 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.