Created
April 20, 2015 10:26
-
-
Save mindaslab/26d8b2370a6f6303cf99 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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