rbysamppi / gmail.com wrote: > Are there any more elegant, concise, pithy, and more Rubyish ways of > doing this? > > def roll(number_of_dice) > sum = 0 > number_of_dice.times do > sum += rand(5).next > end > sum > end > > Thanks in advance! I don't think there's really anything you can do to it, but I would suggest that you add a parameter to set the sides of the dice and also add one to the random output (if it's the random number gen I'm thinking of, it'll give you 0-5 which means your dice have a blank side :P ) -JC