digital literacy for everyone


[lit]

[generate-title]

[lit] a group is one or more lines of text that are not separated by lines of whitespace only: group one this is group one still group one this is group two group three group three also groupsortlen will find groups in text, and sort incoming text by the number of lines in each group: this is group two group three group three also group one this is group one still group one [fig] #### license: creative commons cc0 1.0 (public domain) #### http://creativecommons.org/publicdomain/zero/1.0/ proginf "groupsortlen 0.1, mar 2019 mn" p arrstdin trimlen 0 grouplen 0 topgrouplen 0 forin each p trimlen each rtrim len ifmore trimlen 0 now grouplen plus 1 swap now grouplen fig ifmore grouplen topgrouplen topgrouplen grouplen fig ifequal trimlen 0 grouplen 0 fig next grouplen 0 for group 1 topgrouplen 1 buf arr mid 1 0 forin each p trimlen each rtrim len ifmore trimlen 0 now grouplen plus 1 swap now grouplen buf plus each fig ifequal trimlen 0 ifequal grouplen group forin groupeach buf now groupeach print next now "" print fig buf "" arr mid 1 0 grouplen 0 fig next next
fig main page: [url]https://codeinfig.neocities.org/fig/index.html[url] home: [lit]https://codeinfig.neocities.org[lit]