function gray_code_unrank_test ( )

%*****************************************************************************80
%
%% gray_code_unrank_test() tests gray_code_unrank().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 November 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'gray_code_unrank_test():\n' );
  fprintf ( 1, '  gray_code_unrank() unranks.\n' );

  n = 5;
  ngray = gray_code_enum ( n );

  rank = floor ( ngray / 2 );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Seek the element of rank %d\n', rank );

  t = gray_code_unrank ( rank, n );

  i4vec_print ( n, t, '  The item of the given rank' );

  return
end
