Closed valeatory closed 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.
/(\d+)d(\d)\?(\d+)?+?(\d+)?/
Parser finished. Are there any occasion where the dice rolling notations will have a negative sign in front of it?
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.