8.18
top
← prev up next →

dice-parserπŸ”— i

Carmine Margiotta <car.margiotta@icloud.com>

dice-parser is a tool for parsing and rolling dice expression.

A simple dice expression is in format ndX where n and X are natural numbers or, simply, n. Simple dice expressions can be composed in full dice expressions with + and - operators.

1Parsing simple dice expressionsπŸ”— i

A simple dice expression can be parsed using
>(simple-rollexpression)

For example:
>(defineexpr"6d6")
>(simple-rollexpr)
'(653522)

2Parsing full dice expressionsπŸ”— i

A full dice expression can be parsed using
>(rollexpression)

For example:
>(defineexpr"6d6+1d20-4")
>(rollexpr)
"6d6(6,5,3,5,2,2)+1d20(15)-4"
34

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /