9 unstable releases
0.7.3 | Aug 30, 2021 |
---|---|
0.7.2 | Apr 18, 2021 |
0.6.0 | Aug 21, 2020 |
0.5.1 | May 10, 2020 |
0.3.1 | Mar 22, 2020 |
#5 in #dnd
66 downloads per month
Used in 2 crates
(via dnd_dice_roller)
32KB
757 lines
Dice Command Parser
This library parses a simple dice roll command and produces a representation of the dice that should be rolled and its modifier.
Example input: d6
, 3d20
, d6 + 5
, or 2d20 - 4
, d20+4d
, d100, d100, d100
.
lib.rs
:
This crate provides functionality for the basic parsing of dice roll commands e.g. d100
, d6 + 5
, 2d20 - 1
.
Given some input it will produce a DiceRollWithOp
struct which can be used to then calculate a result.
Dependencies
~1.2–1.8MB
~39K SLoC