Subject: Most elegant way to do this?
From: rbysamppi gmail.com
Date: Tue, 27 Nov 2007 09:20:02 +0900
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!