roll: Roll dice

Description Usage Arguments Value Examples

View source: R/roll.R

Description

Takes a Dungeons & Dragons style dice string, parses it, and rolls it

Usage

1
roll(dice_string, verbose = FALSE, seed = NULL)

Arguments

dice_string

A Dungeons & Dragons style dice string, e.g. "2d4" to roll two four-sided dice and add the result

verbose

Show the details of the roll in the console?

seed

(optional) Random number seed to use

Value

A number representing the result of the die roll

Examples

1
2
3
4
5
roll("d20")
roll("2d8")
roll("2d4+1")
roll("d6*3", seed =  123)
roll("3d6", verbose = TRUE)

Prometheus77/rolldice documentation built on Dec. 18, 2021, 8:40 a.m.