Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include zero in dice roll results #6

Open
eandersons opened this issue Mar 7, 2023 · 3 comments · May be fixed by #7
Open

Include zero in dice roll results #6

eandersons opened this issue Mar 7, 2023 · 3 comments · May be fixed by #7

Comments

@eandersons
Copy link

In some cases zero is desirable in roll results.

I took a quick look at the code, and it seems that zero is never returned as a possible outcome (except for !roll d0 or !roll 3d0 where 0 is the only result).

I would like to try to implement this, but before that some things should be clarified.
What would be the best way to explicitly instruct the !roll command to include zero as one of the possible dice roll outcomes?
A few options come in my mind:

  • !roll 1d9,0;
  • !roll 1d9 --zero or !roll --zero 1d9, or !roll with-zero 1d9;
  • !roll 1d[0-9] or !roll 1d0..9 (this would introduce additional functionality - a possibility to specify an explicit range).

Personally I like the last the most.

I am not completely sure though how well any of these proposed options would comply with the rest of !roll's functionality.

@tulir
Copy link
Member

tulir commented Mar 7, 2023

Math is already supported: !roll 1d10 - 1

@tulir tulir closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2023
@eandersons
Copy link
Author

This issue is not about math.

From what I have observed, !roll 10d9 or !roll 10d9 - 1 will not give a results set that includes zeros (for example: 10d9: 8 0 2 2 5 1 0 7 9 3) because the range always starts from 1, but sometimes zero is desirable as well.

@tulir
Copy link
Member

tulir commented Mar 7, 2023

Right, multiple dice with the show individual rolls option is a different case, all other cases would be about math

@tulir tulir reopened this Mar 7, 2023
@eandersons eandersons linked a pull request Mar 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants