RosettaCodeData/Task/Ordered-words/Icon/ordered-words.icon

11 lines
306 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
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