lib_dice
A dice parsing library uses nom for dice syntax parsing.
Dice string format is {count}d{sides} or {count}d{sides}+{bonus} with to
include a bonus. The regex form is \d+d\d+(\s*\+\s*\d+)? or with capture
groups (\d+)d(\d+)(?:\s*\+\s*(\d+))?
Usage
Cargo.toml
[]
= "1.3.0"
src/main.rs
use DiceRoll;
use FromStr;
Example
The following prompt will start.
Welcome to Dice Line v1.1.0
Press ctrl+c to exit
> 1d8
3
> 3d6 + 8
16
License
lib_dice uses the MIT License