Created
March 29, 2011 02:52
-
-
Save wlangstroth/891727 to your computer and use it in GitHub Desktop.
still ugly, but I like it better
This file contains 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
#!/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