RosettaCodeData/Task/Ordered-words/Icon/ordered-words.icon
2023-07-01 13:44:08 -04:00

10 lines
306 B
Text

link strings
procedure main(A)
f := open(\A[1]) | stop("Give dictionary file name on command line")
every (maxLen := 0, maxLen <= *(w := !f), w == csort(w)) do {
if maxLen <:= *w then maxList := [] #discard any shorter sorted words
put(maxList, w)
}
every write(!\maxList)
end