function clock_solitaire_simulation_test ( )

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

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'clock_solitaire_simulation_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  clock_solitaire_simulation() simulates the game of\n' );
  fprintf ( 1, '  clock solitaire.\n' );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'piles_deal() randomly initializes the card piles.\n' );
  piles = piles_deal ( );
  fprintf ( 1, 'piles_print() prints the current piles.\n' );
  piles_print ( piles );

  win = play ( );
  fprintf ( 1, '\n' );
  if ( win )
    fprintf ( 1, 'play() played one game and won.\n' );
  else
    fprintf ( 1, 'play() played one game and lost.\n' );
  end

  n = 10000;
  play_many ( n );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'clock_solitaire_simulation_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

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

