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.]

4 Responses

  1. Do it!

  2. Given the ridiculous amount of time my brain has insisted on spending thinging about marvelously overengineered ways to do simple arithmetic, I don’t think it’s possible for me not to anymore.

  3. So this is like…Rube Goldberg programming?

  4. Rube Goldberg is certainly one way to approach it. My “strategy” is to impose a ridiculous constraint on what my code is allowed to do, and implement a “well-engineered” framework to get around that constraint, a framework which also happens to be very poorly suited to the implementation language.

    I’ll give the details later — I don’t want to tip my hand just yet.

Comments are closed.