function hexagon_rule_tester ( rule, rule_name )

%*****************************************************************************80
%
%%  hexagon_rule_stroud1_test tests hexagon_rule_stroud1.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 April 2019
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, @rule, a pointer to the rule function.
%
%    Input, string rule_name, a name for the rule.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '%s\n', rule_name );
  fprintf ( 1, '\n' );

  [ n, x, y, w, s ] = rule ( );
  degree_max = s;
  degree = 0;
  ex = 0;
  ey = degree;

  while ( true )

    if ( mod ( ex, 2 ) == 0 && mod ( ey, 2 ) == 0 )

      v = monomial_value_2d ( n, ex, ey, x, y );
      q = hexagon01_area ( ) * w' * v;
      fprintf ( 1, '  %d: Integral x^%d y^%d dxdy = %g\n', degree, ex, ey, q );

    end

    if ( ex < degree )
      ex = ex + 1;
      ey = ey - 1;
    elseif ( degree < degree_max )
      degree = degree + 1;
      ex = 0;
      ey = degree;
    else
      break;
    end

  end

  return
end

