Updated DiceType to allow for more parsing options #304
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DiceType can now support dice (e.g. "2d6+1") as well as simple simple ranges (e.g. "2-12") and constants (e.g. "9").
Simple ranges are implemented as 1dX+Y.
Also, there is a Display implementation that turns the dice back into the string.
And there is an implementation of From<&str> and FromStr for additional parsing/conversion ease.
Changed the default to be 0 instead of 1d4.
Doing the parsing by hand removes regex and lazy_static.
Sorry about the cargo formatting - please feel free to revert that part - my format on save is causing this change.