Skip to content

Instantly share code, notes, and snippets.

@parksilk
Created January 14, 2013 04:22
Show Gist options
  • Save parksilk/4527742 to your computer and use it in GitHub Desktop.
Save parksilk/4527742 to your computer and use it in GitHub Desktop.
Dev Bootcamp exercise 22: Super FizzBuzz
def super_fizzbuzz(array)
result = []
array.each do |i|
if i % 15 == 0
result << "FizzBuzz"
elsif i % 5 == 0
result << "Buzz"
elsif i % 3 == 0
result << "Fizz"
else
result << i
end
end
result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment