dart_dice_parser library
A Parser for dice notation
Usage example:
const input = '2d20-L'; // D20 advantage -- roll 2d20, drop lowest
final diceExpr = DiceExpression.create(input);
for (var i = 0; i < 2; i++) {
final int result = diceExpr.roll();
stdout.writeln("$i : $result");
}
Classes
- DiceExpression
- An abstract expression that can be evaluated.
- DiceRoller
-
A dice roller for M dice of N sides (e.g.
2d6
). A roll returns a list of ints. Includes methods for handling fudge and exploding die. - RollResult
- The result of rolling a dice expression.