simulator (Re: [Icfp04-discuss] three liberal arts)
Kamil Skalski
nazgul at omega.pl
Wed Jun 9 12:14:30 EDT 2004
Wednesday 09 June 2004 11:00, Zsban Ambrus wrote:
> On Wed, Jun 09, 2004 at 01:40:14AM +0200, Laurent Desnogues wrote:
> > Jed Davis wrote:
> >
> > Some gain could come by encoding the map as a one-
> > dimensional array so that direction selection is
> > just loading an offset instead of switching and
> > computing x and y. Since the border of the world
> > is rocky, you can't get wrong using offsets.
>
> I would be really interesetd about how the combat rules could be done fast.
> As implemented in the pseudocode I belive it might be too slow. It might
> help much as I think it is executed a lot of times.
>
> Two things that might help are 1. change the coordinate system so that the
> adjacent_cell function could be as simple as adding one of the vectors
> [1,0], [1,1], [0,1], [-1,0], [-1,-1], [0,-1]; or 2. calculating the number
> of neighbours short-circuitting, that is, if you see two cells which does
> not have red ants, than it's impossible that there are 5 red ants in the 6
> cells. I didn't do any of these optimizations.
Red Team's strategy was amazing:
* *
* F +
* *
* are enemies, + is friend
when + goes to take Food, enemies make one step forward and kill +
* *
* +
* *
* *
* +
* *
More information about the Icfp04-discuss
mailing list