eurydice_engine
The dice probability engine used by Eurydice, an implementation of the AnyDice language.
use Engine;
let mut engine = new;
let report = engine.run_source;
assert!;
assert_eq!;
assert_eq!;
The language is documented in the Eurydice specification; it is a near-strict superset of AnyDice, documented at the AnyDice docs
Probabilities are computed exactly with rational arithmetic and converted to
f64 only at the end. When possible, computation uses the Icepool
algorithm.[^1]
This crate offers no real extension points today, but methods to have the host program insert new primitives or modify the AST are planned.
Features
serde derives Serialize on the public report types. Enable it when a
frontend needs to serialize engine results.
This project is not affiliated with AnyDice
AnyDice was created by Jasper Flick. This is an independent reimplementation of its language.
License
Apache-2.0.
[^1]: Liu, A. J. (2022). Icepool: Efficient Computation of Dice Pool Probabilities. Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, 18(1), 258-265. https://doi.org/10.1609/aiide.v18i1.21971