Last active
August 29, 2015 14:01
-
-
Save tkbeili/a9d6f514980b6b89e39a to your computer and use it in GitHub Desktop.
FizzBuzz Solution
This file contains hidden or 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
| for number in 1..100 | |
| if number % 3 == 0 && number % 5 == 0 | |
| puts "FIZZBUZZ" | |
| elsif number % 3 == 0 | |
| puts "FIZZ" | |
| elsif number % 5 == 0 | |
| puts "BUZZ" | |
| else | |
| puts number | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment