function jai_alai_simulation_test ( )

%*****************************************************************************00
%
%% jai_alai_simulation_test() tests jai_alai_simulation().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 July 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../jai_alai_simulation');

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'jai_alai_simulation_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test jai_alai_simulation()\n' );
%
%  Equal strengths.
%
  strength = ones ( 8, 1 );
  n = 10000;
  results = jai_alai_simulation ( strength, n );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Case of equal strengths:\n' );
  fprintf ( 1, '  Player  Strength  Wins  Percentage\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 8
    fprintf ( 1, '  %d  %8.4f  %4d  %8.4f\n', i, strength(i), results(i), results(i) / n );
  end
%
%  Random strengths.
%
  strength = rand ( 8, 1 );
  n = 10000;
  results = jai_alai_simulation ( strength, n );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Case of random strengths\n' );
  fprintf ( 1, '  Player  Wins  Percentage\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 8
    fprintf ( 1, '  %d  %8.4f  %4d  %8.4f\n', i, strength(i), results(i), results(i)/n );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'jai_alai_simulation_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../jai_alai_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

