Something
Emporium

Calc-Q

Calc-Q

Well, I didn't win. In fact, I didn't make it to the twelve finalists. Sure, I'm disappointed, but I can't feel too bad if Ecumenicalculator didn't make it either. It's an implementation of untyped lambda calculus that uses Church numerals (which are pretty similar to <N; 0, +1>). The code is amazingly terse and lucid, and basically puts my entry to shame. But, for all the talk on the contest page about clever code, it looks as if they've mostly just gone for funny entries - 8 out of 10 of the finalists so far have, I think, been in that category.

I've packaged up my entry, adding support for the GTK+ skeleton as I went, and getting the Windows version working with Wine as a bonus. There are binaries for Windows, for if you don't have a compiler or don't know how to use one, and I've also got binaries for Ubuntu in there, although I'm not sure how well they'll work. See the download link at the bottom.

All the entries are available as a torrent from a thread on the OMGWTF forums. But I'll save you the trouble of downloading all 348 entries. The most common solution was to hard code the answers to the test cases into the calculator. About 80(!) of the entries took this approach. The early entry numbers were over-represented in the approach, because it only takes five minutes to make a calculator like that.

Another common idea was to plug the numbers into Google calculator or a web service. Grepping among the entries for "google" gives 29 entries. Searches for "curl", "wget" and "HTTP/1.1" turn up a few more. About 15 entries involve Roman numerals. Weed all those out and you have about 210 entries that might be novel.

As for cool approaches, VICE is pretty good (and made it to the finals), but it has no implementation for division - the author just did (op1 / op2). You'd think he'd, at the very least, have done something iterative or using his other three functions. Two people implemented (what they describe as) neural networks. Apart from Ecumenicalculator, only one other person made use of a successor function (and they, curiously, had a predecessor function too). Someone used Newton's divided differences interpolation polynomial, which certainly sounds cool, and only one other person used Newton-Raphson, so my fears about unoriginality were unfounded.

Download Calc-Q (691 kB, 675 KiB)
Dominic