Skip to content

Instantly share code, notes, and snippets.

Alex Singleton alexanderjsingleton

Block or report user

Report or block alexanderjsingleton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Kerrick
Kerrick / fizzbuzz.rb
Created Apr 24, 2012
Different solutions for Fizz Buzz in Ruby
View fizzbuzz.rb
def fizz_buzz_1(max)
arr = []
(1..max).each do |n|
if ((n % 3 == 0) && (n % 5 == 0))
arr << "FizzBuzz"
elsif (n % 3 == 0)
arr << "Fizz"
elsif (n % 5 == 0)
arr << "Buzz"
else
You can’t perform that action at this time.