ICFP 2010 Contest Continues

Jun 19, 2010 07:59


As I said I wanted to participate in ICFP contest for such a long time. Reading a memoirs  of contestants was akin to reading a thriller or an investigative novel of some sort. So, I was looking forward to this year.

I guess lots of people will be complaining about organization, so everything below is not a complain, but rather couple thoughts I have got so far.

First and foremost the task itself is difficult to understand. I have read it multiple times, tried this and that with the organizers’ server and the only functional part in the task is constructing so called circuits. That is the part Fuels. Everything else seems to be just a disguise or a decoy.

So far, one has to construct a logic circuit, that uses ternary logic instead of binary (aha, there was even computer on ternary logic - Setun). Circuits are written using following notation.

19L: 12R13R0#1R12R, 14R0L0#4R9L, 9R10R0#3L8L, 2L17R0#5L9R, 15R1L0#10R13R, 3L18R0#6L15L, 5L11R0#13L12L, 19R16R0#11R8R, 2R7R0#11L10L, 1R3R0#18L2L, 8R4L0#16L2R, 8L7L0#15R6R, 6R0R0#14L0L, 6L4R0#14R0R, 12L13L0#17L1L, 5R11L0#16R4L, 10L15L0#17R7R, 14L16L0#18R3R, 9L17L0#19R5R, X18L0#X7L: 19L
Based on description, I guess that in 19L : ... : 19L 19 is number of flip-flop elements ( well, flip-flop-flap, since it is ternary logic ), and every element has left (L) and right (R) inputs and left (L) and right (R) outputs.

Every circuit seems to be a Counter. Instead of bits, though, elements of the counter store trits (that is ternary bit - 0,1,2 instead of 0,1). And the signal is a sequence of trits as well.

Typical elements looks like

12R13R0#1R12R,

which I think reads “this element has left input connected to 12th element’s right out and right input connected to 13th right out, has a state (or counter) set to 0 and its left out connected to 1st element’s right in, and right out to 12th right in”

Supposedly one needs to create a program that would generate these circuits and then submit these circuits as a fuel for cars.

So far I have constructed some, but all of them are rejected. Server says something along the lines “illegal prefix 20101020210 blah blah blah”. I think one should reverse engineer organizer’s circuit interpreter based on this outputs. Which is difficult. What doesn’t help is that they use ternary logic.

By the way, since I am using Python, these links came really handy:
Logic Circuits in Python - Part One
Logic Circuits in Python - Part Two

Also I think, it would be nice to have something like Parsec for Python in order to write your own circuit interpreter. I know that there’s pyparsing but it’s not as terse and flexible as Parsec.

I will try to get somewhere with all this but my hope and interest fades as fog in early morning.

Originally published at Feast For Eyes. You can comment here or there.

programming, icfp

Previous post Next post
Up