09-08-2013, 12:27 AM
Given that he requested one for a Dungeons and Dragons styled system, he would be more familiar with 4sided dice, 6 siders, 8siders and so forth. Hence, my version was designed to use method names that replicated the AD&D dice rolls, and include the number of dice at the same time. The call of ...
...would match that of the Dice.d6(3). It rolls a six-sided die 3 times. But the Dice.d6 command (and others included) are meant to make it easier to use. I went with an easy-to-use gamer mentality for d4, d6, d8, d10, d12 and d20 rolls.
And call it an old-school methodology that I grew up with that reinitialized values ( the result = 0 ) as well as a mentality to include failsafe routines.
Code:
strength_roll = Dice.dice_roll(6, 3)
...would match that of the Dice.d6(3). It rolls a six-sided die 3 times. But the Dice.d6 command (and others included) are meant to make it easier to use. I went with an easy-to-use gamer mentality for d4, d6, d8, d10, d12 and d20 rolls.
And call it an old-school methodology that I grew up with that reinitialized values ( the result = 0 ) as well as a mentality to include failsafe routines.