Comment on Write a program that makes 2 + 2 = 5parentComments−hpvic0312yHere's a ruby solution that only affects 2+2: class Fixnum alias_method :old_plus, :+ def +(other) return 5 if (self == 2 && other == 2) old_plus(other) end end
Comments
Here's a ruby solution that only affects 2+2: