[Icfp04-discuss] Cute Strategy

Evan Simpson evan at 4-am.com
Mon Jun 7 23:43:21 EDT 2004


I thought of this too late to use, but wanted to share.

Arrange eight ants on your hill, like so (letters are ants, numbers are 
markers, 'x' are empty hexes):

  S A B S
1 2 x x x
  S C D S

#A and #B are facing SW, while #C and #D are facing NE.

#A and #D are running a loop that looks like:

"trap watcher"
if sense.foe.ahead:
     mark5
else:
     unmark5
go("trap watcher")

...while #B and #C are running:

"trap closer"
if sense.marker5.rightahead:
     if move:
         turn.right
         turn.right
         turn.right
         "trap reset"
         if move:
             turn.right
             turn.right
             turn.right
             go("trap closer")
         go("trap reset")
go("trap closer")

Ants delivering food look for the '1' marker, enter the tunnel, drop 
their food on the '2' marker, then continue through and out the other 
end.  If an enemy ant enters either end of the tunnel, it will be killed 
4 ticks later.

Theoretically one of the 'S' ants can be killed, but only if the circle 
is closed within the 4 tick window.

Cheers,

Evan @ 4-am


More information about the Icfp04-discuss mailing list