2023-07-01 11:58:00 -04:00
|
|
|
fp = io.open( "dictionary.txt" )
|
|
|
|
|
|
|
|
|
|
maxlen = 0
|
|
|
|
|
list = {}
|
|
|
|
|
|
|
|
|
|
for w in fp:lines() do
|
|
|
|
|
ordered = true
|
|
|
|
|
for l = 2, string.len(w) do
|
2026-02-01 16:33:20 -08:00
|
|
|
if string.byte( w, l-1 ) > string.byte( w, l ) then
|
|
|
|
|
ordered = false
|
|
|
|
|
break
|
|
|
|
|
end -- if
|
|
|
|
|
end -- for
|
2023-07-01 11:58:00 -04:00
|
|
|
if ordered then
|
2026-02-01 16:33:20 -08:00
|
|
|
if string.len(w) > maxlen then
|
|
|
|
|
list = {}
|
|
|
|
|
list[1] = w
|
|
|
|
|
maxlen = string.len(w)
|
|
|
|
|
elseif string.len(w) == maxlen then
|
|
|
|
|
list[#list+1] = w
|
|
|
|
|
end -- if
|
|
|
|
|
end -- if
|
|
|
|
|
end -- for
|
2023-07-01 11:58:00 -04:00
|
|
|
|
|
|
|
|
for _, w in pairs(list) do
|
|
|
|
|
print( w )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
fp:close()
|