function p = tile_matrix ( name )

%*****************************************************************************80
%
%% tile_matrix() returns a 0/1 matrix defining a calendar puzzle tile.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 August 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    character NAME: 'L', 'N', 'O', 'P', 'U', 'V', 'Y', or 'Z'.
%
%  Output:
%
%    integer P(P_M,P_N), a matrix of 0's and 1's describing the tile.
%
  if ( upper ( name ) == 'L' )

    p = [ 0, 0, 0, 1; ...
          1, 1, 1, 1 ];

  elseif ( upper ( name ) == 'N' )

    p = [ 1, 1, 0, 0; ...
          0, 1, 1, 1 ];

  elseif ( upper ( name ) == 'O' )

    p = [ 1, 1; ...
          1, 1; ...
          1, 1 ];

  elseif ( upper ( name ) == 'P' )

    p = [ 1, 1; ...
          1, 1; ...
          1, 0 ];

  elseif ( upper ( name ) == 'U' )

    p = [ 1, 0, 1; ...
          1, 1, 1 ];

  elseif ( upper ( name ) == 'V' )

    p = [ 1, 0, 0; ...
          1, 0, 0; ...
          1, 1, 1 ];

  elseif ( upper ( name ) == 'Y' )

    p = [ 0, 0, 1, 0; ...
          1, 1, 1, 1 ];

  elseif ( upper ( name ) == 'Z' )

    p = [ 1, 1, 0; ...
          0, 1, 0; ...
          0, 1, 1 ];

  else

    fprintf ( 1, '\n' );
    fprintf ( 1, 'pentomino_matrix(): Fatal error!\n' );
    fprintf ( 1, '  Illegal name = "%s"\n', name );
    fprintf ( 1, '  Legal names: F, I, L, N, P, T, U, V, W, X, Y, Z.\n' );
    error ( 'pentomino_matrix(): Fatal error!\n' );

  end

  return
end

