Dice notation (e.g., "2d6+3", "4d6kh3")
Optional configuration (RNG or seed)
Complete roll result with total and metadata
// Random roll
const result = roll('2d6+3');
console.log(result.total); // 5-15
// Seeded for reproducibility
const r1 = roll('4d6', { seed: 'test' });
const r2 = roll('4d6', { seed: 'test' });
r1.total === r2.total; // true
// Custom RNG for testing
const result = roll('1d20', { rng: createMockRng([15]) });
result.total; // 15
Parses and evaluates a dice notation string.