Looks like this method isn't working quite right. Try this:

  def fac(num)
    return 1 if num.zero?
    1.upto(num).inject(:\*)
  end