function caesar_test ( )

%*****************************************************************************80
%
%% caesar_test() tests caesar().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    07 December 2018
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../caesar' )

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'caesar_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s.\n', version ( ) );
  fprintf ( 1, '  Test caesar().\n' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  s2 = caesar ( s1, k ), varying K.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   K  ---------------S1----------------  ---------------S2----------------\n' );
  fprintf ( 1, '\n' );
  for k = -5 : 5
    s1 = 'A man, a plan, a canal: Panama!';
    s2 = caesar ( s1, k );
    fprintf ( 1, '  %2d  "%s"  "%s"\n', k, s1, s2 );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  s2 = caesar ( s1,  k ).\n' );
  fprintf ( 1, '  s3 = caesar ( s2, -k )\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   K  ------------S1------------  ------------S2------------  ------------S3------------\n' );
  fprintf ( 1, '\n' );
  for k = -5 : 5
    s1 = 'The key is under the mat';
    s2 = caesar ( s1, k );
    s3 = caesar ( s2, -k );
    fprintf ( 1, '  %2d  "%s"  "%s"  "%s"\n', k, s1, s2, s3 );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'caesar_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../caesar' )

  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

