Created
October 27, 2014 12:15
-
-
Save rbraaf/59b8ae1426f2c436b1dd to your computer and use it in GitHub Desktop.
FizzBuzz.rb
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
| (1..100).each {|num| | |
| if (num % 3 == 0 && num % 5 == 0) | |
| puts "FizzBuzz" | |
| elsif (num % 3 == 0) | |
| puts "Fizz" | |
| elsif (num % 5 == 0) | |
| puts "Buzz" | |
| else | |
| puts num | |
| end | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment