I am sorely tempted to enter The Olympiad of Misguided Geeks at Worse Than Failure Programming Contest (a.k.a. OMGWTF). The challenge: to write the most “Clever” (and possibly “Buggy”) calculator possible without being “Ugly” or failing the test cases.

Given the skeleton code provided, all that has to be done is to implement four functions:

  • One that adds two floating point numbers.
  • One that subtracts them.
  • One that multiplies them.
  • One that divides them.

Of course, a “Correct” solution is downright trivial, obvious, and straightforward. “Correct” is also not a judging criterion.

I’ve got some ideas for ways to attack this, though (un)fortunately I don’t see a good way at the moment to use Church numerals with floating point. But that’s hardly my only idea.

Ultimately, the question is: can the Code Master General code like a Code Master Second Lieutenant?

[Editor’s note: This is also not the post I alluded to, um, two posts ago now.]