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.

Navigation

Advertisements

Entry #100049: OMG Enterprise edition

by Peter Gordon
Its based on the skeleton, and the only modified file is "CalcFunc.cpp", so you should have no problems building it. I built my exe with GCC, though, so if it DOESN'T pass the test cases when compiled with VC, let me know and i'll give you the DevCPP project and makefiles so you can try it in the same IDE, but it should work.

I wrote this entry as if I was so stupid that I had, for some reason, convinced myself that C/C++ had no arithmetic operators. Thats right, not one place in the code uses +, -, / or *.

Also, all the maths are done on a string of charactors. It takes the floats and converts them to string buffers before doing the maths.

Also, to make it enterprisey, the actual operations performed by +, /, - and * are configured via an XML configuration file.

I especially like the way the "accuracy" of the integer division operation is "improved" to pass the test cases.

There are many, many more WTFs in the code.

Download2 Comments