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 #100154: ASCII calc

by jj the monkey wrench
===========================================================================
Entry for the omgwtf programming contest by the mighty jj the monkey wrench
===========================================================================

This is my first time working with C/C++ and I'm not too impressed. Anyway, I couldn't figure out how to write bad/ugly/buggy code. As a result I kinda had a hard time coming up with enough code to fill up the ascii art... but I sorta managed.

A few ideas I had but didn't have time to do (or the know how with C++) was to take screenshots of the input values and then OCR it to get the value. I thought that might be fun. I also wanted to make a dictionary of all posible (up to a certian number) combinations with the values being the result, but C++ doesn't have dictionaries like python... and it would end up being over 100 Mb big so I dropped that idea.

Included files that I made or modified
-----------------------------------------------------------------------

* CalcFunc.cpp - Compilable ASCII version of source.
* pic.png - Image used to convert source to ASCII.
* source.cpp - The original source file for the calculator. Read it if you want some comprehensible code.
* source_ascii.py - The python script I threw together to convert the code to ASCII.


Running on *nix
-----------------------------------------------------------------------
$ make
$ ./calculator



Running on windows
-----------------------------------------------------------------------
Absolutely no idea. jj the monkey wrench not use windows. jj the monkey wrench use KDE. Linux better. Windows evil. Linux cool. Jingly keys make jj the monkey wrench feel all better.


Converting the source to ASCII
-----------------------------------------------------------------------
$ python source_ascii.py pic.png source.cpp CalcFunc.cpp

Download0 Comments