knitr::opts_chunk$set(echo = TRUE) devtools::load_all() set.seed(12345)
roll('d6') # roll d6 roll('4d6') # roll 4d6 roll('4d6k3') # roll 4d6 keep 3 highest roll('4d6kl3') # roll 4d6 keep lowest 3 roll('4d6d1') # roll 4d6 drop 1 lowest roll('4d6dh1') # roll 4d6 drop highest 1 roll('4d6+3') # roll 4d6 add 3 roll('4d6r1r2') # roll 4d6 reroll 1s and 2s roll('4d6r<2') # same as above roll('4d6r1ro2') # roll 4d6 reroll 1s but reroll 2s only once roll('5d2!') # exploding dice roll('5d2!!') # compounding dice roll('6d6+4d4-3d5') # multiple rolls r('1d6') # shortcut function
Other variables that roll
funciton accepts are
critMark
: TRUE
by default. If TRUE
it adds stars around the dice roll in printed output if it is max or min value for the dicevocal
: TRUE
by default. If FALSE
disables printing of dice rollsreturnRolls
: FALSE
by default. If TRUE
returns a list instead of an integer that includes rolled and dropped dice along with the dice sumr("10d10dl3",returnRolls = TRUE, vocal = FALSE)
Probabilities of outcomes can be calculated with diceProb
function
diceProb('4d6d1') %>% as.table %>% plot diceProb('1d4!',explodeDepth = 4) %>% as.table %>% plot diceProb('1d4ro1!',explodeDepth = 4) %>% as.table %>% plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.