lcb931023 / pathfinder_random_character_generator

http://lcb931023.github.io/pathfinder_random_character_generator
GNU General Public License v3.0
1 stars 0 forks source link

Dice text parser #6

Closed valeatory closed 10 years ago

valeatory commented 10 years ago

In some parts of the json, there are randomizations defined by dice+adds. We need a class/method to parse these in the format of 2d6*2+4, meaning the sum of two random numbers between one and six, then multiplied by two, and added to four.

lcb931023 commented 10 years ago

/(\d+)d(\d)\?(\d+)?+?(\d+)?/

lcb931023 commented 10 years ago

Parser finished. Are there any occasion where the dice rolling notations will have a negative sign in front of it?