function atbash_test ( )

%*****************************************************************************80
%
%% atbash_test() tests atbash().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 November 2018
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../atbash' )

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'atbash_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test atbash():\n' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  ATBASH_ENCRYPT encrypts a plain text using the Atbash\n' );
  fprintf ( 1, '  substitution cipher.\n' );
  fprintf ( 1, '  ATBASH_ENCRYPT can also decrypt an encryted text.\n' );
%
%  Test 1
%
  plain = 'A man, a plan, a canal - Panama!';
  crypt = atbash_encrypt ( plain );
  decrypt = atbash_encrypt ( crypt );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'PLAIN:   "%s"\n', plain );
  fprintf ( 1, 'CRYPT:   "%s"\n', crypt );
  fprintf ( 1, 'DECRYPT: "%s"\n', decrypt );
%
%  Test 2.
%
  plain = 'There are a thousand hacking at the branches of evil for every one who is striking at its root.';
  crypt = atbash_encrypt ( plain );
  crypt2 = atbash_encrypt ( crypt );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'PLAIN:   "%s"\n', plain );
  fprintf ( 1, 'CRYPT:   "%s"\n', crypt );
  fprintf ( 1, 'DECRYPT: "%s"\n', crypt2 );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'atbash_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../atbash' )

  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

