function mcnugget_ways_test ( )

%*****************************************************************************80
%
%% mcnugget_ways_test() tests mcnugget_ways().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 December 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'mcnugget_ways_test():\n' );
  fprintf ( 1, '  mcnugget_ways() reports the number of ways you can\n' );
  fprintf ( 1, '  order exactly N chicken McNuggets when they only come in\n' );
  fprintf ( 1, '  packages of 6, 9, and 20.\n' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '    N  Ways(N)\n' );
  fprintf ( 1, '\n' );

  a = [ 6, 9, 20 ];
  nmax = 50;
  ways = mcnugget_ways ( a, nmax );
  ways_exact = [ ...
    1,  0,  0,  0,  0,  0,  1,  0,  0,  1, ...
    0,  0,  1,  0,  0,  1,  0,  0,  2,  0, ...
    1,  1,  0,  0,  2,  0,  1,  2,  0,  1, ...
    2,  0,  1,  2,  0,  1,  3,  0,  2,  2, ...
    1,  1,  3,  0,  2,  3,  1,  2,  3,  1, ...
    2,  3,  1,  2,  4,  1,  3,  3,  2,  2, ...
    5,  1,  3,  4,  2,  3,  5,  2,  3,  5, ...
    2,  3,  6,  2,  4,  5,  3,  3,  7,  2, ...
    5,  6,  3,  4,  7,  3,  5,  7,  3,  5, ...
    8,  3,  6,  7,  4,  5,  9,  3,  7,  8, ...
    5 ...
  ];

  for n = 0 : nmax
    fprintf ( 1, '  %2d  %3d  %3d\n', n, ways ( n + 1 ), ways_exact ( n + 1 ) );
  end

  return
end

