function cell_ij_fill_test ( )

%*****************************************************************************80
%
%% CELL_IJ_FILL_TEST tests CELL_IJ_FILL.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    07 November 2017
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'CELL_IJ_FILL_TEST:\n' );
  fprintf ( 1, '  Fill in unit cells indexed by (I,J)\n' );
  fprintf ( 1, '  using matrix coordinate system.\n' );

  MARIO = [ ...
   0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0;
   0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0;
   0, 0, 6, 6, 6, 5, 5, 5, 1, 5, 0, 0, 0;
   0, 6, 5, 6, 5, 5, 5, 5, 1, 5, 5, 5, 0;
   0, 6, 5, 6, 6, 5, 5, 5, 5, 1, 5, 5, 5;
   0, 6, 6, 5, 5, 5, 5, 5, 1, 1, 1, 1, 0;
   0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0;
   0, 0, 2, 2, 3, 2, 2, 2, 2, 0, 0, 0, 0;
   0, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 0, 0;
   2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 0;
   5, 5, 2, 3, 4, 3, 3, 4, 3, 2, 5, 5, 0;
   5, 5, 5, 3, 3, 3, 3, 3, 3, 5, 5, 5, 0;
   5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 0;
   0, 0, 3, 3, 3, 0, 0, 3, 3, 3, 0, 0, 0;
   0, 6, 6, 6, 0, 0, 0, 0, 6, 6, 6, 0, 0;
   6, 6, 6, 6, 0, 0, 0, 0, 6, 6, 6, 6, 0];

  [ m, n ] = size ( MARIO );
%
%  0: white
%  1: black
%  2: red
%  3: blue
%  4: yellow
%  5: beige
%  6: brown
%
  clf ( );
  hold ( 'on' );

  for i = 1 : m
    for j = 1 : n

      k = MARIO(i,j);

      if ( k == 0 )
        color = [ 1.0, 1.0, 1.0 ];
      elseif ( k == 1 )
        color = [ 0.0, 0.0, 0.0 ];
      elseif ( k == 2 )
        color = [ 1.0, 0.0, 0.0 ];
      elseif ( k == 3 )
        color = [ 0.0, 0.0, 1.0 ];
      elseif ( k == 4 )
        color = [ 1.0, 1.0, 0.0 ];
      elseif ( k == 5 )
        color = [ 1.0, 0.8, 0.6 ];
      elseif ( k == 6 )
        color = [ 0.8, 0.4, 0.0 ];
      end

      cell_ij_fill ( m, i, j, color );

    end
  end
  axis ( 'equal' );
  axis ( 'off' );
  hold ( 'off' );

  filename = 'cell_ij_fill_test.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end
