Created
March 8, 2013 02:42
-
-
Save ismaelga/5113834 to your computer and use it in GitHub Desktop.
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
def multiple number | |
proc {|n| (n % number) == 0 rescue nil } | |
end | |
(0..100).each do |number| | |
puts case number | |
when multiple(15) then "FizzBuzz" | |
when multiple(5) then "Buzz" | |
when multiple(3) then "Fizz" | |
else number | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment