Closed reyrodrigez closed 10 years ago
I recommend:
Dice.roll('d10'); Dice.roll('1'); Dice.roll('-2'); and Dice.sumRolls(array dices);
function Dice.sumRolls(new_rolls){ result = 0; new_rolls.forEach (function(one_roll){ result = result + Dice.roll(one_roll); }); return result }
A Dice Roller Singleton would be really useful and could be included to every individual charsheet project. Let's move the conversation here from the pull request. As we discussed earlier a method is required that returns a number from any dice formula. Example:
3d6
returns a number between 3 and 18,2d10+1d4+3
returns a number between 6 and 27, etc...