Ruby: Perfect for 1984
by jd
NotRocketSurgery is proud to bring you this time wasting tidbit: how to make 2 + 2 = 5.
1 2 3 4 5 6 7 8 9 10 11 |
class Fixnum alias_method :add, :+ def +(n) if self == 2 && n == 2 5 else add(n) end end end |
NotRocketSurgery is proud to bring you this time wasting tidbit: how to make 2 + 2 = 5.
1 2 3 4 5 6 7 8 9 10 11 |
class Fixnum alias_method :add, :+ def +(n) if self == 2 && n == 2 5 else add(n) end end end |
January 23rd, 2007 at 04:03 PM This is why JD is awesome. This is why Ruby is awesome.