function bal_seq_random_test ( )

%*****************************************************************************80
%
%% bal_seq_random_test() tests bal_seq_random().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 June 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'bal_seq_random_test():\n' );
  fprintf ( 1, '  bal_seq_random() randomly selects a balanced\n' );
  fprintf ( 1, '  sequence of N terms\n' );

  n = 5;
  bal_seq_num = bal_seq_enum ( n );

  fprintf ( 1, '  Let n = %d\n', n );
  fprintf ( 1, '  Number of possible balanced sequences is %d\n', bal_seq_num );

  fprintf ( 1,'\n' );

  for test = 1 : 10

    t = bal_seq_random ( n );
    for i = 1 : 2 * n
       fprintf ( 1, '%2d', t(i) );
    end
    fprintf ( 1, '\n' );

  end

  return
end
