Humblemonk / DiceMaiden

Dice bot for Discord
Apache License 2.0
117 stars 51 forks source link

Zero-indexed Dice (0-9 d10s, 0-5 d6s, etc.) #214

Closed Teguki closed 1 week ago

Teguki commented 1 year ago

It'd be nice if there were a way roll d10s and have them present the way they normally do on a table - 0-9 instead of 1-10.

Perhaps there could be an alias that's more general than just d10s - say, "2z4" instead of "2d4" - that rolls and adds together 0-indexed dice instead of 1-indexed dice. The output would be something like "Request: [3z4] Roll: [3, 2, 0] Result: 5"

Zero-indexed dice aren't used very often, but they do occur: the Royal Game of Ur uses 0-indexed coin flips (d2s, 0-1) to determine the number of tiles you must move.

r4dian commented 10 months ago

Just -1 ?

Teguki commented 10 months ago

Subtracting 1 is a solution, but it's a clumsy patch over the problem, and cumbersome to type in larger dice formulae.

Adding zero-indexed dice to Dice Maiden vastly simplifies some areas of dice maths (see the percentile advantage readability issue: #216 ), and makes outputs involving lots of dice more readable.

Custom-range dice would be a more general solution, but they'd be harder to write concisely, I think. Perhaps something like "3d2t5", meaning "3 dice, range 2 to 5"?

Humblemonk commented 1 week ago

Unfortunately, this is not an easy task as it would require rewriting a lot of the Dice-Bag gem that this bot uses. For now I am going to have to say do the -1 recommendation.