function percolation_simulation_test ( )

%*****************************************************************************80
%
%% percolation_simulation_test() tests percolation_simulation().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 July 2022
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../percolation_simulation' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'percolation_simulation_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  percolation_simulation() simulates percolation.\n' );
  fprintf ( 1, '  A rectangular region is formed by a grid of M x N squares.\n' );
  fprintf ( 1, '  Each square may be porous or solid.\n' );
  fprintf ( 1, '  We are interested in paths of porous squares connecting\n' );
  fprintf ( 1, '  the top and bottom, or the left and right boundaries.\n' );

  m = 32;
  n = 32;
  p = 0.60;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Grid uses %d rows x %d columns\n', m, n );
  fprintf ( 1, '  Prescribed probability of occupation = %g\n', p );

  percolation_simulation ( m, n, p );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'percolation_simulation_test()\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../percolation_simulation' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

