function pariomino_embed_list_test ( )

%*****************************************************************************80
%
%% pariomino_embed_list_test tests pariomino_embed_list.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%   09 May 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pariomino_embed_list_test:\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  pariomino_embed_list() lists the offsets used\n' );
  fprintf ( 1, '  to embed a fixed pariomino in a region.\n' );

  mr = 4;
  nr = 4;
  r = [ ...
     0, +1, -1, +1; 
    +1, -1,  0, -1;
    -1, +1, -1, +1; 
    +1,  0, +1, -1 ];

  pariomino_print ( r, '  region R:' );

  mp = 3;
  np = 2;
  p = [ ...
     0, +1;
     0, -1;
    -1, +1 ];

  pariomino_print ( p, '  pariomino P:' );
%
%  Get the number of embeddings.
%
  number = pariomino_embed_number ( r, p );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  P can be embedded in R in %d ways\n', number );
%
%  Get the list of embeddings.
%
  list = pariomino_embed_list ( r, p, number );

  for k = 1 : number
    mk = list(k,1);
    nk = list(k,2);
    mq = mr;
    nq = nr;
    q = r;
    q(1+mk:mp+mk,1+nk:np+nk) = q(1+mk:mp+mk,1+nk:np+nk) + p(1:mp,1:np);
    fprintf ( 1, '\n' );
    fprintf ( 1, '  Embedding number %d:\n', k );
    fprintf ( 1, '\n' );
    for i = 1 : mq
      fprintf ( 1, '  ' );
      for j = 1 : nq
        if ( q(i,j) == -2 )
          fprintf ( 1, '*' );
        elseif ( q(i,j) == -1 )
          fprintf ( 1, 'B' ); 
        elseif ( q(i,j) == 0 ) 
          fprintf ( 1, '.' );
        elseif ( q(i,j) == +1 ) 
          fprintf ( 1, 'W' );
        elseif ( q(i,j) == +2 ) 
          fprintf ( 1, '*' );
        end
      end
      fprintf ( 1, '\n' );
    end
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pariomino_embed_list_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
