Created
April 27, 2012 20:52
-
-
Save anonymous/2513041 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primes = [2] | |
current_number = 3 | |
while primes.length < 10 | |
primes.each do |p| | |
unless current_number % p == 0 | |
primes.push(current_number) | |
end | |
end | |
current_number += 2 | |
end | |
puts primes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment