Skip to content

Instantly share code, notes, and snippets.

@KarlHerler
Created January 6, 2011 11:58
Show Gist options
  • Save KarlHerler/767807 to your computer and use it in GitHub Desktop.
Save KarlHerler/767807 to your computer and use it in GitHub Desktop.
part of the hoppity puzzle
def hoppity(x)
(1..(x)).each do |i|
x = (i%3==0 && i%5==0) ? "Hop" : (i%3==0) ? "Hoppity" : (i%5==0) ? "Hophop" : nil
puts x if x
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment