Evaluates a parsed AST and returns the roll result.
The parsed AST node
Random number generator to use for dice rolls
Optional evaluation options
Complete roll result with total and metadata
const ast = parse('2d6+3');const rng = new SeededRNG('test');const result = evaluate(ast, rng);console.log(result.total); // Sum of dice plus 3 Copy
const ast = parse('2d6+3');const rng = new SeededRNG('test');const result = evaluate(ast, rng);console.log(result.total); // Sum of dice plus 3
Evaluates a parsed AST and returns the roll result.