Skip to content

Instantly share code, notes, and snippets.

@mindaslab
Created April 20, 2015 10:26
Show Gist options
  • Save mindaslab/26d8b2370a6f6303cf99 to your computer and use it in GitHub Desktop.
Save mindaslab/26d8b2370a6f6303cf99 to your computer and use it in GitHub Desktop.
class Fixnum
def prime?
return true if self == 1
2.upto(self) do |num|
if self % num == 0
return self == num
1.upto(100) do |num|
puts num if num.prime?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment