Skip to content

Instantly share code, notes, and snippets.

View alexanderjsingleton's full-sized avatar

Alex Singleton alexanderjsingleton

View GitHub Profile
@Kerrick
Kerrick / fizzbuzz.rb
Created April 24, 2012 20:36
Different solutions for Fizz Buzz in Ruby
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