Learn R Programming

casino (version 0.1.0)

Deck: Deck R6 Class

Description

Deck R6 Class

Usage

Deck

Arguments

Format

An object of class R6ClassGenerator of length 24.

Examples

Run this code
# NOT RUN {
# create a new deck
x <- Deck$new()
x

# draw a card
x$draw(1)
x

# draw 10 cards
x$draw(10)

# check how many cards are left
x$cards_left()

# reset the deck
x$shuffle()
x

# create a deck composed of 5 decks
x <- Deck$new(decks = 5)
x
# }

Run the code above in your browser using DataLab