function compnz_random_test ( )

%*****************************************************************************80
%
%% compnz_random_test() tests compnz_random().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 July 2021
%
%  Author:
%
%    John Burkardt
%
  k = 5;
  n = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'compnz_random_test():\n' );
  fprintf ( 1, '  compnz_random() generates random compositions\n' );
  fprintf ( 1, '  using nonzero parts.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Seeking random compositions of N = %d\n', n );
  fprintf ( 1, '  using %d nonzero parts.\n', k );
  fprintf ( 1, '\n' );

  for i = 1 : 5
    a = compnz_random ( n, k );
    for j = 1 : k
      fprintf ( 1, '  %2d', a(j) );
    end
    fprintf ( 1, '\n' );
  end

  return
end
