A stateless service for tabletop games over IRC. ROLL/CALC evaluate a dice + math expression (ROLL rounds to a whole number, CALC keeps decimals); EXROLL/EXCALC also show each die. Supports NdM / dM / d% dice, + - * / ^ %, parentheses, implicit multiplication, unary minus, pi/e, a set of functions (sqrt, floor, sin, min, …), and N~expr to repeat a roll. Modernises the C++ original: it ships its own Mersenne-Twister RNG in C and parses via shunting-yard with a variadic-argument hack; this is a typed AST from a small recursive-descent parser plus the rand crate — shorter, and the dice/sides/total caps make abuse (999999d6) a clean error instead of a hang. Opt-in (add "diceserv" to [modules].services).
9 lines
229 B
TOML
9 lines
229 B
TOML
[package]
|
|
name = "fedserv-diceserv"
|
|
version = "0.0.1"
|
|
edition = "2021"
|
|
description = "DiceServ: a dice-roll and math-expression service for tabletop games over IRC."
|
|
|
|
[dependencies]
|
|
fedserv-api = { path = "../api" }
|
|
rand = "0.8"
|