About The Contest

The first ever Olympiad of Misguided Geeks contest at Worse Than Failure (or OMGWTF for short) is a new kind of programming contest. Readers are invited to be creative with devising a calculator with the craziest code they can write. One lucky and potentially insane winner will get either a brand new MacBook Pro or comparable Sony VAIO laptop.



Entry #100054: Calc.WTF

by Cole I
This calculator should have never left Visual Studio. The main functionality takes place in CalcMaestro.(cpp/h), which is a template based class which will operate with any integer or floating-point type as a template parameter (constrained by type size limits). By default, I have it set to working at `long double`.

The main operations of CalcMaestro simply increment or decrement the main value however much is needed to attain the desired value.

At some points in the code, it will verify periodically its calculations by taking the current value, dicing it up recreating the related strings, just in case there was an error. If something did in fact go wrong, however, nothing really happens.

For the operators + and -, we use increments instead of using these operators. For operators / and *, we use some fun things in math.h, because who knows if / and * are reliable?

Download0 Comments