Skip to content

Instantly share code, notes, and snippets.

@orlybg
Last active December 18, 2015 02:29
Show Gist options
  • Save orlybg/5711178 to your computer and use it in GitHub Desktop.
Save orlybg/5711178 to your computer and use it in GitHub Desktop.
#classic
def is_prime n
for d in 2..(n - 1)
if (n % d) == 0
return "no"
end
return "yes"
end
end
puts is_prime(3)
puts is_prime(8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment