justinian / dice

Golang dice library
MIT License
20 stars 13 forks source link

Fixes automatic Result choice for certain dice formats #3

Closed frenata closed 8 years ago

frenata commented 8 years ago

See the test for details, but the motivating string for these changes was:

"3d8v3", which dice.Roll currently interprets as a StdResult, not a VsResult, the 'v3' listed as the reason for the StdResult.

This does enforce that the 'reason' must be seperated from the dice format by a space.

justinian commented 8 years ago

Thanks for being thorough and adding tests. check.v1 is the gocheck library, but it's completely compatible with standard go tests, so those are totally fine.

I'm OK with requiring a space between the roll descriptors and the reason string - I can't imagine actually writing one without a space.

:+1: