Vlek / roll-cli

CLI-based dice roller with all of the features you could want.
Other
7 stars 1 forks source link

Non-left-to-right parsing of dice roll notation #85

Open Vlek opened 2 years ago

Vlek commented 2 years ago

Things like 4d6K1d2 are not happening from left-to-right. Right now, this is the order that they're being handled:

❯ roll 4d6K1d2 -v
Rolled: 4d6: [6, 2, 5, 6]
Rolled: 1d2: [1]
Adding: 19 + 1 = 20
Keeping highest: 1: [6]
6

The expected order would be: Roll 4d6 Keep the highest 1 Roll the highest 1d6 roll's worth of d2

Vlek commented 2 years ago

If I do this right, this should also resolve #45.