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 #100332: Pandoora's Calculator #4

by Dave
WTF features:

Architecture inspired by IBM's Pandoora architecture with five architectural layers:
* view layer
* controller layer
* business object layer
* business service layer
* persistance service layer

Custom Long class for integer arithmetic. Includes:
* carry-ripple addition
* twos-complement negative representation (used for subtraction)
* grade-school multiplication and division algorithms

Custom Float class for doing exact calculations with rational numbers. Represents numbers as a whole part, a numerator and a denominator using custom Longs.

DWIM-based Programmer Error mitigation via Soundex-based service lookups.

Gratuitous namespace pollution via "using namespace std;" in header files.

Casting away of const when attempting to call non-const methods on a const object.

Download0 Comments