Last active
March 29, 2016 16:58
-
-
Save stupeters187/8bb7b2b6c25fd874315bf415e2fc3c79 to your computer and use it in GitHub Desktop.
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
def fizzbuzz(a, b) | |
a.upto(b) do |i| | |
if i % 5 == 0 && i % 3 == 0 | |
puts "FizzBuzz" | |
elsif i % 5 == 0 | |
puts "Buzz" | |
elsif i % 3 == 0 | |
puts "Fizz" | |
else | |
puts i | |
end | |
end | |
end | |
fizzbuzz(300, 400) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment