HELP PATH_TO_MOVES                            Jocelyn Paine October 1992


This module defines a routine for converting a path, expressed as a list
of points, into a list of bug moves. You supply it with the path and the
bug's initial heading, and it returns a list of actions, and a new
heading. To load it, do
    lib path_to_moves;


PUBLIC path_to_moves( heading, path ) -> new_heading -> moves:

'heading' must be a unit vector giving the bug's current direction.
'path' is a list of points. Each point must be horizontally or
vertically adjacent to the next.

The routine returns two results, the new heading, also as a unit vector,
and a list of moves. Each element of this is a word, one of "left",
"right", "forward", or "back".

Example:
--------

    path_to_moves( [0 1],
                   [ [1 2] [1 3] [2 3] [3 3] [3 2] ]
    ) -> d -> moves;
    d=>
    moves=>
gives
    ** [0 -1]
    ** [forward right forward forward right forward]


For how to use vectors, see HELP VEC. They are implemented as lists, so
you can write vector constants as such.                          
