On Tue, Sep 25, 2012 at 1:57 PM, Roelof Wobben <rwobben / hotmail.com> wrote:

> But now I'm getting this error : undefined method `+' for nil:NilClass

On what line?  Presumably the one that says:

> dice.each {|el| dice[el] += 1}

This would imply that dice[el] is nil.  Not surprising, since |el| is
the element, not the index.  Maybe you meant something like:

  dice.map! { |el| el + 1 }

or

  dice.each_index { |idx| dice[idx] += 1 }

?

-Dave

-- 
Dave Aronson, T. Rex of Codosaurus, LLC... aka
Available Secret-Cleared Ruby/Rails Freelancer
(NoVa/DC/Remote); see http://www.Codosaur.us/.