Skip to content

Instantly share code, notes, and snippets.

@wlangstroth
Created March 29, 2011 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wlangstroth/891727 to your computer and use it in GitHub Desktop.
Save wlangstroth/891727 to your computer and use it in GitHub Desktop.
still ugly, but I like it better
#!/usr/bin/env ruby
(1..100).each do |n|
out = ""
if n.modulo(3) == 0
out += "Fizz"
end
if n.modulo(5) == 0
out += "Buzz"
end
if out == ""
out = n.to_s
end
puts out
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment