Slot Machine

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

set.seed(101315)

Example

library(casino)

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

# Sit at a slot machine with default bet of 5
x <- Slots$new(who = "Gritty", bet = 5)

# Play a game
x$play()

# Play 5 games
x$play(spins = 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.