Created
August 11, 2015 01:47
-
-
Save nanonanomachine/45c6f2e5889046e9155a to your computer and use it in GitHub Desktop.
Ruby FizzBuzz
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
(1..100).each do |n| | |
p case 0 | |
when n % 15 then "FizzBuzz" | |
when n % 3 then "Fizz" | |
when n % 5 then "Buzz" | |
else n | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment