function i4row_take_random_test ( )

%*****************************************************************************80
%
%% i4row_take_random_test tests i4row_take_random.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 January 2020
%
%  Author:
%
%    John Burkardt
%
  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4row_take_random_test:\n' );
  fprintf ( 1, '  Take a random row from an I4ROW\n' );

  m = 10;
  n = 4;
  A = i4mat_indicator ( m, n );
%
%  Take a row, and append two more.
%
  for i = 1 : 5
    fprintf ( 1, '\n' );
    fprintf ( 1, '  Current matrix:\n' );
    fprintf ( 1, '\n' );
    disp ( A );
    [ A, r, index ] = i4row_take_random ( A );
    label = sprintf ( '  Choice #%d is row %d', i, index );
    i4vec_transpose_print ( n, r, label );
    new_rows = randi ( [1,m*n], 2, n );
    A = [ A; new_rows ];
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Final matrix A:\n' );
  fprintf ( 1, '\n' );
  disp ( A );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4row_take_random_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  return
end

