-
-
Save ggongaware/3351008 to your computer and use it in GitHub Desktop.
FIZZ BUZZ! This is to make sure that no one (myself mainly) has to figure out the fizz buzz problem anymore!
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 |x| | |
str = ((x%3) == 0 ? "fizz" : "") + ((x%5) == 0 ? "buzz" : "") | |
puts str.empty? ? x : str | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment