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

feature: roll the dice #84

Open
marqh opened this issue Apr 6, 2022 · 1 comment
Open

feature: roll the dice #84

marqh opened this issue Apr 6, 2022 · 1 comment

Comments

@marqh
Copy link

marqh commented Apr 6, 2022

feed me tips and target points on coding and i'll happily implement

interface suggestion:

sp0rkle: roll <n> d<d>

args:

  • n optional (default 1)
  • d required

behaviour:

return dice roll number set for n dice of size d
integer list based on (pseudo)random number generator

e.g.

sp0rkle: roll d4
3
sp0rkle roll 2 d6
3 5
sp0rkle roll 3 d12
1 11 8
@fluffle
Copy link
Owner

fluffle commented Apr 7, 2022

Heyoo, thanks for the suggestion :-)

This probably belongs in drivers/decisiondriver, which does random number stuff. If I was you i'd make the spaces around the d optional -- NdX is pretty common dnd terminology aiui.

You might find the Lexer in package util helpful for string parsing. You can see some simple example usage in drivers/decisiondriver/decisiondriver.go, in the quoteSplit function.

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

No branches or pull requests

2 participants