Deck: Deck R6 Class

Description Usage Format Examples

Description

Deck R6 Class

Usage

1

Format

An object of class R6ClassGenerator of length 24.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# 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

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