Created
December 1, 2015 16:46
-
-
Save amaxwellblair/3bdd002ba99f36393d07 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 supafizbuz(max_num) | |
range = (0..max_num).to_a | |
range.each do |num| | |
if num % 3 == 0 | |
if num % 7 == 0 | |
if num % 5 == 0 | |
puts("SuperFizzBuzz") | |
next | |
end | |
puts("SuperFizz") | |
next | |
end | |
puts("Fizz") | |
next | |
elsif num % 7 == 0 | |
if num % 5 == 0 | |
puts("SuperBuzz") | |
next | |
end | |
puts("Super") | |
next | |
elsif num % 5 == 0 | |
puts("Buzz") | |
next | |
end | |
puts(num) | |
end | |
return nil | |
end | |
supafizbuz(1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment