[Icfp04-discuss] my Perl submission
Mario Storti
mstorti at intec.unl.edu.ar
Mon Jun 7 18:04:02 EDT 2004
First of all, I have to congratulate the organizers for the choice of
problem and how the task was exposed. Very fun!!
I encouraged students from my class to participate. They sent at least
one submission (I think there are more). They were absolutely
delighted with the contest.
I have browsed the problems from other years and I think that this
one is certainly among the best if it is not the best!!! When I
suggested my students to participate I wondered whether it would be
interesting to participate or not. Now I'm very happy for having
encouraged them to participate.
[In a previous post introducing me I inserted a link to the web page
of the course, but it had a typo. The correct page is
http://venus.ceride.gov.ar/aed mostly in spanish!! By the way, we live
in Santa Fe, Argentina. ]
My entry can be downloaded at
http://venus.ceride.gov.ar/twiki/bin/view/Cimec/ICFPContestEntry
My web page is http://venus.ceride.gov.ar/mstorti
An extract of the features in my submission.
* I wrote a server (server.pl) and compiler (zumb) in Perl. I planned
first to make it in Scheme (Guile) but I am rather starting with
Scheme and finally switched to Perl (which I'm using since long time
ago).
* The server has a limited graphical output, but it can be called in
background so that you can make matches in background in order to
find the best ants.
* The compiler has abstract labels, goto's, and subroutines (they are
rather macros). After I wrote that I thought that perhaps this could
be done better with M4, but since I'm more proficient in Perl I
wrote the compiler in perl. The source files have extension .zb and
you compile them as $ zumb ant.zb ant.as, where `ant.as' is the
machine code ant. The compiler performed at 5secs every 1000 steps
in a 100x100 map with 180ants (it is O(#ants), the size of the board
is irrelevant for the speed).
* Initially I wrote a very complex ant-brain that numbered the cells
from 63 at the hill (home) decreasing towards infinity. These was
very interesting, I had to write additions and substractions in
binary with the compiler but in practice the ant turned out to be
too slow. These are ant2 and ant3 in the package, these were not
submitted.
* After that (around sunday morning) I started writing an ant that
marks towards away from the hill while searchng food and then
unmarks while going home. Also it tries to find unmarked cells while
searching food and marked cells while going home. These are ant4 and
ant5. They used only one marker.
* Then I tried to figure out how to use the other markers. I have
little time to experience, but I found beneficial to divide the ants
in several species and let each species one marker. Then while
searching food you look for any of the markers to be off. And going
home any marker to be on. I can't how this works, but in matches
this seems to improve.
* I never reached the level of martial arts.
Happy hacking!!
Mario
More information about the Icfp04-discuss
mailing list