Created
August 10, 2026 12:26
-
-
Save hilbix/22816af649fb44c5d9c1345e67b51007 to your computer and use it in GitHub Desktop.
Is "bekloppt" really the greatest word of German, which is sorted alphabetically?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| gawk ' | |
| BEGIN { | |
| s=0; | |
| for (x=60; ++x<=122; s++) | |
| nr[sprintf("%c", x)] = s; | |
| } | |
| { | |
| x=tolower($0); | |
| l=""; | |
| s=0; | |
| do | |
| { | |
| c = substr(x,0,1) | |
| if (c < l) next; | |
| s += nr[c]; | |
| l = c; | |
| x = substr(x,2) | |
| } while(x != ""); | |
| print length($0) " " s " " $0 | |
| } | |
| ' /usr/share/dict/* | | |
| sort -u | sort -n |
hilbix
commented
Aug 10, 2026
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment