function truel_simulation_test ( )

%*****************************************************************************80
%
%% truel_simulation_test tests truel_simulation.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    02 April 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../truel_simulation' )

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'truel_simulation_test:\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Test truel_simulation.\n' );

  p = [ 2/6, 4/6, 5/6 ];
  strategy = 1;
  truel_num = 1000;
  [ s, turn_average ] = truel_simulation ( p, strategy, truel_num );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Truel statistics estimated from %d simulations\n', truel_num );
  fprintf ( 1, '  Strategy = %d\n', strategy );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Player  Accuracy  Survival\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 3
    fprintf ( 1, '  %d  %8.2f  %8.2f\n', i, p(i), s(i) );
  end

  p = [ 2/6, 4/6, 5/6 ];
  strategy = 4;
  truel_num = 1000;
  [ s, turn_average ] = truel_simulation ( p, strategy, truel_num );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Truel statistics estimated from %d simulations\n', truel_num );
  fprintf ( 1, '  Strategy = %d\n', strategy );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Player  Accuracy  Survival\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 3
    fprintf ( 1, '  %d  %8.2f  %8.2f\n', i, p(i), s(i) );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'truel_simulation_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../truel_simulation' )

  return
end
