DicEx.RNG.Deterministic (dicEx v0.1.0)

Copy Markdown View Source

A deterministic, list-backed RNG for tests.

Not for production. It is not passed as a bare module — thread it as a {DicEx.RNG.Deterministic, outcomes} tuple so the roller can carry its state between rolls:

DicEx.roll("3d6", rng: {DicEx.RNG.Deterministic, [4, 2, 6]})

Outcomes are popped in order; once the list is exhausted, further rolls return 1. Because every value is pinned, modifier logic (keep/drop, explode, reroll) becomes fully predictable — ideal for golden-path tests.

Summary

Functions

Builds a deterministic RNG state from an ordered list of outcomes.

Functions

new(outcomes)

Builds a deterministic RNG state from an ordered list of outcomes.