function stats = jai_alai_simulation ( strength, n )

%*****************************************************************************80
%
%% jai_alai_simulation() simulates many games of jai_alai.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 July 2019
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Steven Skiena,
%    Calculated Bets,
%    Computers, Gambling, and Mathematical Modeling to Win,
%    Cambridge University Press, 2001,
%    ISBN13: 978-0521009621.
%
%  Input:
%
%    real strength(8), the strengths of each player.
%
%    integer n, the number of games to play.
%
%  Output:
%
%    integer stats(8), the number of wins for each player.
%
  stats = zeros ( 8, 1 );
  for i = 1 : n
    [ winner, games ] = jai_alai_match ( strength );
    stats(winner) = stats(winner) + 1;
  end

  return
end

