Pathfinder

This program has two main parts.  It has a GameState data structure
which maintains a mental picture of the game board, including a map of
how to get from any location to any other location by the shortest
path (this is lazily computed, and we took steps to ensure that it
didn't grow too large).  The second part is a decision system.  This
proceeds by proposing a list of actions, each derived from a specific
desire (investigate an unknown home base, go fetch a known package,
kill an adjacent robot).  Each action is then given a priority.
Finally, a set of restrictions on the action is computed, in an effort
to keep the robot from being killed.  Each restriction has a priority,
and actions that are less urgent than that are discarded.  The robot
also remembers its recent actions, and if it detects a (short) loop,
it temporarily ignores the desire that led to the loop.

Pathfinding is done by a marching squares algorithm that yields the
distance to any point and the set of directions that lead there on the
shortest path.  Once done, it is very cheap to measure the distance to
any point, so for example we try to pick up the packages that are
closest to their destination, we fetch the nearest package, etc.

It requires GHC 5.04 to build.


