5. The Rubyist Loop


#1

Where am I going wrong? These instructions seem quite simple so I don't see what could be wrong. Please help.

prime_array ||= []

prime = Prime.new
n.times
{prime_array.push(prime.next)}
end
prime_array
end

first_n_primes(10)


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.