DiceParser class

A Parser for dice notation

Constructors

DiceParser([Random? random])
Constructs a dice parser, dice roller injectable for mocking random

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

evaluate(String diceStr) → Result
Parses the given dice expression return evaluate-able Result.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
roll(String diceStr) int
Evaluates the input dice expression and returns evaluated result.
rollN(String diceStr, int num) Stream<int>
Lazy iterable of rolling given dice expression N times. Results returned as stream.
stats({required String diceStr, int numRolls = 10000, int precision = 3}) Future<Map<String, dynamic>>
Performs N rolls and outputs stats (stddev, mean, min/max, and a histogram)
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited