Find words which contain the most consonants: Difference between revisions

m
(Added Algol 68)
Line 321:
# consonants, store it prefixed by the max abs char #
# complement of the number of consonants in it, so we #
# can sort the words into reverse consonant count order #
words[ w count +:= 1 ] := REPR ( max abs char - consonants ) + word;
IF w length > max length THEN max length := w length FI
Line 348:
FI;
print( ( " ", " " * ( max length - w length ), word ) );
IF NOT ( need nl := ( p count +:= 1 ) MOD 5 /= 0 ) THEN
needprint( nl( :=newline TRUE) )
ELSE
print( ( newline ) );
need nl := FALSE
FI
OD
3,032

edits