function combination_lock_test ( )

%*****************************************************************************80
%
%% MAIN is the main program for COMBINATION_LOCK.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license. 
%
%  Modified:
%
%    20 December 2018
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer M, the number of dials.
%
%    Input, integer N, the number of symbols on each dial.
%    We assume the symbols are the integers 0 to N-1.
%
%    Input, integer C(M), the combination.
%
  addpath ( '../combination_lock' );

  m = 4;
  n = 5;
  c = [ 1, 2, 3, 4 ];

  timestamp ( )
  fprintf ( 1, '\n' );
  fprintf ( 1, 'COMBINATION_LOCK_TEST\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  COMBINATION_LOCK seeks the combination of a lock.\n' );
  fprintf ( 1, '  A combination lock consists of M dials,\n' );
  fprintf ( 1, '  each having N symbols.\n' );
  fprintf ( 1, '  We seek to determine the combination C.\n' );
%
%  Report on the problem data.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The number of dials is M = %d\n', m );
  fprintf ( 1, '  The number of symbols is N = %d\n', n );
  fprintf ( 1, '  The number of possible combinations is M^N = %d\n', n ^ m );
  i4vec_print ( m, c, '  The combination:' );

  step = combination_lock ( m, n, c );

  if ( step == -1 )
    fprintf ( 1, '\n' )
    fprintf ( 1, '  The program did NOT find the combination!\n' );
  else
    fprintf ( 1, '\n' )
    fprintf ( 1, '  The combination was found on step %d\n', step );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'COMBINATION_LOCK_TEST\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../combination_lock' );

  return
end

