Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
27
Task/Ordered-words/Lingo/ordered-words.lingo
Normal file
27
Task/Ordered-words/Lingo/ordered-words.lingo
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
-- Contents of unixdict.txt passed as string
|
||||
on printLongestOrderedWords (words)
|
||||
res = []
|
||||
maxlen = 0
|
||||
_player.itemDelimiter = numtochar(10)
|
||||
cnt = words.item.count
|
||||
repeat with i = 1 to cnt
|
||||
w = words.item[i]
|
||||
len = w.length
|
||||
ordered = TRUE
|
||||
repeat with j = 2 to len
|
||||
if chartonum(w.char[j-1])>chartonum(w.char[j]) then
|
||||
ordered = FALSE
|
||||
exit repeat
|
||||
end if
|
||||
end repeat
|
||||
if ordered then
|
||||
if len > maxlen then
|
||||
res = [w]
|
||||
maxlen = len
|
||||
else if len = maxlen then
|
||||
res.add(w)
|
||||
end if
|
||||
end if
|
||||
end repeat
|
||||
put res
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue