22 July, 2007

IIFIFFIFPFIIICCCIICIFPPCFIIC

Since 12PM European time on Friday (3AM here), I've been working on and off on the ICFP contest (http://icfpcontest.org). It is a "functional programming" contest by name, but just a difficult programming puzzle by nature.

The general idea is that we have a blob of text (containing only I, C, F, and P) about 7.5MB long, that we have to get a picture from. First, there is a procedure in which the text is read in chunks, and then modified (by prepending), until it is all gone. During this, a new stream of text is created, which must be parsed into instructions for how to draw on a 600x600 canvas. Once we can do this (according to some given rules) correctly, we have to figure out how to create an almost completely new image by adding some prefix to the original blob and running it through again.

It is a pretty intense puzzle, as they've basically created a virtual stack machine in machine code written in 4 characters, but the cool thing is that after two days, we've begun to understand a significant portion of it. It's pretty cool being able to look at a bunch of seemingly random characters (see title) and actually see form and semantic meaning come out.

No comments: