McNuggets problem: Difference between revisions

Content added Content deleted
m (→‎{{header|ALGOL 68}}: Use the simplification in the BASIC, Comal, Draco, Dyalect etc. samples where the loop counters do the additions)
m (→‎{{header|ALGOL 68}}: Additional micro-tweak)
Line 120: Line 120:
# show the highest number that cannot be formed #
# show the highest number that cannot be formed #
INT largest := -1;
INT largest := -1;
FOR i FROM UPB sum BY -1 TO LWB sum WHILE largest := i; sum[ i ] DO SKIP OD;
FOR i FROM UPB sum BY -1 TO LWB sum WHILE sum[ largest := i ] DO SKIP OD;
print( ( "The largest non McNugget number is: "
print( ( "The largest non McNugget number is: "
, whole( largest, 0 )
, whole( largest, 0 )