function average = walker_2d_l2_average ( n, m )

%% WALKER_2D_L2_AVERAGE averages the length of a random walk in the CIRCLE.
%
%  It is assumed the walker starts at (0,0), and randomly steps North,
%  South, East or West until sqrt(X^2+Y^2) has the value N.  
%  The number of steps taken is the length of the walk.
%
%  This program takes M random walks, and reports the average length.
%
  average = 0.0;

  for i = 1 : m
    track = walker_2d_l2 ( n );
    average = average + length ( track ) - 1;
  end

  average = average / m;

  return
end
