function triangle_print ( t, label )

%*****************************************************************************80
%
%% triangle_print() prints the triangles that form a polyiamond.
%
%  Discussion:
%
%    The triangle list is a list of the IJK parallelogram triangles
%    that constitute the polyiamond.
%    If k = 0, the "ijk" triangle has vertices
%      (i-1,j-1), (i,j-1), (i-1,j).
%    If k = 1, the "ijk" triangle has vertices
%      (i,j), (i-1,j), (i,j-1).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 November 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer T(TN,3), the IJK parallelogram triangle coordinates of the 
%    triangles making up the polyiamond.  
%
%    string LABEL, a label to be printed.  
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '%s\n', label );
  fprintf ( 1, '\n' );

  [ m, n ] = size ( t );

  if ( n ~= 3 )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'triangle_print - Fatal error!\n' );
    fprintf ( 1, '  Input array P has column dimension %d, should be 3.\n', n );
    error ( 'triangle_print - Fatal error!' );
  end

  if ( m <= 0 )
    fprintf ( 1, '  [ Null array ]\n' );
  else
    for i = 1 : m
      fprintf ( 1, ' %2d:', i );
      for j = 1 : 3
        fprintf ( 1, ' %d', t(i,j) );
      end
      fprintf ( 1, '\n' );
    end
  end

  return
end

