Created
July 26, 2014 03:08
-
-
Save andyweiss1982/5bdfa62daed28e63671d to your computer and use it in GitHub Desktop.
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 { |i| | |
if i % 3 == 0 and i % 5 !=0 | |
i = "Fizz" | |
elsif i % 5 == 0 and i % 3 != 0 | |
i = "Buzz" | |
elsif i % 3 == 0 and i % 5 == 0 | |
i = "FizzBuzz" | |
end | |
puts i | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment