#dnd #dice #parser #ttrpg


A library for parsing basic Genesys dice roll commands

2 releases

0.1.1 May 18, 2022
0.1.0 May 17, 2022

#10 in #dnd

Used in genesys-dice-roller

MIT license

252 lines

Dice Command Parser

This library parses a simple Genesys dice roll string (also works for Star Wars FFG RPG) and produces a representation of the dice that should be rolled and its modifier.

Example input: 2g1r1p, yyypp, difficulty difficulty ability proficiency etc.


This crate provides functionality for the basic parsing of dice roll commands e.g. yyypp, 2g1y2p, difficulty difficulty ability proficiency. Given some input it will produce a DiceRoll struct which can be used to then calculate a result.


~39K SLoC