fucking up ruby

1 Jul 11:27pm (3 months ago) reply

class Fixnum
  alias :plus :+
  def + other
    if self == 1
      plus(other).plus 1
    else
      plus(other)
    end
  end
end

puts 1 + 2
puts 2 + 2
puts (1 + 2) == (2 + 2)

yes, it outputs:


4
4
true

Edit