Skip to content

Instantly share code, notes, and snippets.

@J-Scag
Created October 11, 2013 15:38
Show Gist options
  • Select an option

  • Save J-Scag/6936923 to your computer and use it in GitHub Desktop.

Select an option

Save J-Scag/6936923 to your computer and use it in GitHub Desktop.
Prime finder for Flatiron School day 7
def prime_slow?(number)
(2..number/2).each {|num| return false if number % num == 0}
true
end
puts prime_slow?(19)
puts prime_slow?(14)
puts prime_slow?(157)
puts prime_slow?(273)
puts prime_slow?(451)
puts prime_slow?(100101)
def prime_better?(number)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment