Sha256: e98a0af71867697df7a7f6d66bf5202e44bc08af3170f237508c50e9d69954af

Contents?: true

Size: 565 Bytes

Versions: 1

Compression:

Stored size: 565 Bytes

Contents

class FizzBuzz

  def crunch
    return_values = Array.new

    (1..100).each do |n|
      if (n % 15) == 0
         return_values << "FizzBuzz"
      elsif (n % 5) == 0
        return_values << "Buzz"
      elsif (n % 3) == 0
        return_values << "Fizz"
      else
        return_values << n
      end
    end

    return return_values
  end

  def fizz?(n)
    if (n % 3) == 0
      return :true
    end
  end


  def buzz?(n)
    if (n % 5) == 0
      return :true
    end
  end


  def fizzbuzz?(n)
    if (n % 15) == 0
      return :true
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fizz-buzz-0.1.0 lib/fizz-buzz.rb