CREATING SQUIRREL AGENTS

Squirrel agents are simply programs that communicate with the server,
server.scm, over TCP on port 8123.  They can be written in any language that
supports TCP communication, like Python, C, Java or Prolog.  Some of the
details of this comunication can be inferred from the wall-follower.scm
program, but here is a more complete story.

After a client connects on port 8123, the server sends the squirrel name to
the client.  (It's one of Nutty, Skwirl, Edgy, or Wally, depending on whether
it starts facing N, S, E or W.)  From then on, the client may send any number
of actions each of which will cause the server to respond with a single reply,
after a delay corresponding to the duration of the action.  The actions and
replies are presented below.  Sending an action is normally done by writing
the action to the TCP port followed by an end-of-line and a command that
flushes the output.  Receiving a reply is done by reading from the TCP port.

A client would normally wait for the response from the server before sending
the next action, but it need not. However, the server will only read the next
action sent by the client after it has sent the reply to the previous one.
The server interacts with each client on a different thread, so not sending an
action causes no delay for the other clients.  If at any point the client
closes the connection, it cannot be restarted.

The actions and their responses are as follows: (Note: a response of "fail"
simply means that the action did not have its normal intended effect, although
it continues to have the normal duration.)

   Action	     Response
   ------	     --------  
   left		     ok
   right	     ok
   forward	     ok or fail
   pick		     ok or fail
   drop		     ok or fail
   eat		     ok or fail
   build	     ok or fail   
   feel		     an integer from 0 to 100
   look		     wall or nothing
   smell	     a list (n m) where n and m are integers >= 0
                       n is for acorns, m is for squirrels
   listen	     a list whose elements are lists (i j), 
		       where i and j are integers

In addition, a client can send "quit" and the server will terminate the
connection.  Anything else, such as "help", will cause the server to respond
with the list of actions above.

A client squirrel can decide what actions to send any way it wants.  All the
information in the server.scm program (for example, the size of the grid, the
number of acorns, how far other squirrels can be heard etc) is fair game.
Note that each squirrel starts in a corner with a wall behind it and to its
left. What the squirrel will not know at the start is the location of the
acorns and the position and length of the wall segments, which are distributed
uniformly at random.  In some cases, the distribution of acorns and walls is
not "fair" including even boxing the squirrel in. It is up to the squirrel to
do the best it can even in such situations.

