dice-notation-java icon indicating copy to clipboard operation
dice-notation-java copied to clipboard

Tools and parsers for handling Dice/RPG notation using Java

Results 8 dice-notation-java issues
Sort by recently updated
recently updated
newest added

Hi, I try to use this librairy for a little game for my boy, but (maybe it already exists), i can't find the way to have the detail of rolls...

tools

For example: - Repeat the highest value (every 6 in any d6) - Ignore the lowest/highest value - Keep the lowest/highest value These rules are applied to the parsed expression....

antlr grammar
tools

sometimes, though usually its rare, an RPG will ask for multiplication or division. Here is an example from the freely available "Basic Rules" of Dungeons & Dragons 5th Edition: ##...

Multiple dice groups could be supported. They would be separated by commas: 1d6, 2d10+5

antlr grammar

Currently parsed grammars can only return integers. This means that divisions may not return the correct value. For example '3/2' will return '1', not '1.5'.

parser

https://github.com/antlr/grammars-v4 This repository includes several grammar examples. Check the way these are defined and tested.

The dice model may be better placed in its own model. Maybe even separated into an API and its implementation. Rollers and similar functional classes would be included in the...

This expression is accepted: ``` 1d20-5+2d6 ``` While this one is rejected: ``` 1d20- 5 + 2d6 ``` They are both valid, and should parse into the same tree.

antlr grammar