function gray_code_rank_test ( )

%*****************************************************************************80
%
%% GRAY_CODE_RANK_TEST tests GRAY_CODE_RANK.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 November 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'GRAY_CODE_RANK_TEST\n' );
  fprintf ( 1, '  GRAY_CODE_RANK ranks a given Gray code.\n' );

  n = 5;
  t = [ 1, 1, 0, 0, 0 ];

  rank = gray_code_rank ( n, t );

  i4vec_print ( n, t, '  Element to be ranked:' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Computed rank: %d\n', rank );

  return
end
