function variominoes_print ( mp, np, p_num, p, label )

%*****************************************************************************80
%
%% variominoes_print() prints variominoes packed in an array.
%
%  Discussion:
%
%    A polyomino is a shape formed by connecting unit squares edgewise
%
%    A variomino is a polyomino in which each square has been assigned
%    a value between 1 and v.
%
%    A variomino can be represented by an MxN matrix, whose entries are
%    between 1 and v for squares that are part of the variomino, 
%    and 0 otherwise.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 April 2023
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer mp, np: the rows and columns in the representation.
%
%    integer p_num: the number of variominoes.
%
%    integer p(mp,np,p_num): a matrix representing the variominoes.  
%
%    string label: a label to be printed first.  
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '%s\n', label );
  fprintf ( 1, '\n' );

  if ( mp <= 0 | np <= 0 | p_num <= 0 )
    fprintf ( 1, '  [ Null matrix ]\n' );
  else
    fprintf ( 1, '  %dx%d array of %d variominoes:\n', mp, np, p_num );
    for k = 1 : p_num
      q = variomino_condense ( p(1:mp,1:np,k) );
      label2 = sprintf ( '  variomino #%d', k );
      variomino_print ( q, label2 );
    end
  end

  return
end
