Calculates bowling scores in Ruby