parse_dice_formula {tidydice} | R Documentation |
Given a dice formula string, split it and return a dataframe with the list of functions.
Description
This is the main function to parse a string containing complex formula specifications for rolling dice.
Usage
parse_dice_formula(dice_formula)
Arguments
dice_formula |
A string containing a dice formula, e.g. 1d6e2+1d4 |
Details
The input can be a string containing specifications for multiple dice, e.g.:
1d6e6 -> roll 1 six-sided dice, explode on 6
1d6e6+2d4-1d10 -> Roll 1 six-sided dice, explode on 6, plus two 4-sided dice, subract one 10-sided dice
This is inspired by Avrae's bot syntax for rolling dice. See https://github.com/avrae/d20
[Package tidydice version 1.0.0 Index]