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 #100189: Romanorum Computus

by Michael Ensly
-- The WTF that is Romanorum Computus --

The basic concept is that numbers are converted to roman numeral form and arithemic operations are performed on them in this form before converting them back into ordinary decimal numbers. No actual roman numerals are displayed on screen, but internally all numbers are 5000 character strings holding roman numerals. The basic algorithms are all from http://en.wikipedia.org/wiki/Roman_arithmetic and all work perfectly... in theory. This particular implementation however, has its... erm... flaws. The bubble sort for instance; doesn't actually DO anything, due to mistakes I can't be bothered fixing, leading to some unlikely results when dealing with obscure numbers like eight. By pure coincedence, this doesn't affect any test cases. There are also nice little pictures to illustrate what buttons are pressed.

-- Compiling --

To compile Romanorum Computus unzip contents to a folder and open RomComp.vcproj. From here there are two options:

1 - To simply run the program just press F5 as usual, sometimes linker errors will occur if the drop-down box next to the play button is set to 'Debug', having it on 'Release' is better.

2 - To compile to run outside VS2005, build the program as usual with F6. Then, assuming the output directory of the compiler is different from the source folder, copy over the .bmp files. This isn't critial, but the pretty pictures won't come up otherwise.

For more advanced division (eg 1 / 20) to work, comment out line 382. HOWEVER, this will stop test case WTF117 from running outside Visual Studio. ie, option 2 is out of the question for testing if line 382 is uncommented. I have no idea why it works without this line when run inside Visual Studio.

-- Running --

Don't try anything too tricky or make any typos when running Romanorum Computus. All test cases pass, but doing something such as 0 * 999999 instead of 999999 * 0 will screw it up bigtime.

-- Contents of zip --

Inside the zip file is:
- The equivalent files to what was in the skeleton
structure: RomComp.vcproj, Main.h, Main.cpp, calcfunc.h
and calcfunc.cpp
- These notes in notes.txt
- The Excel spreadsheet I used while debugging, thought I
may as well chuck it in
- 19 .bmp images, 18 for the UI and 1 just because

Download0 Comments