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 #100123: WTF Web Calc

by Dave C.
The application is a web server that handles calculator UI generation
and logic through dynamic HTML and Javascript. It is written entirely in C and uses no third-party libraries. Firefox is launched to access the web server running on localhost.

When the user presses a calculator button, an AJAX call (XMLHttpRequest) is sent to the application, indicating the button press. When "=" is pressed, the calculation is processed by accessing Google. The response is "screen scraped" to extract the result and sent it back to the client.

Download0 Comments