Anonymous user
Ordered words: Difference between revisions
Added missing type; removed HTTP access as file cannot be loaded at the given address (so used a local copy); other minor changes.
(Added missing type; removed HTTP access as file cannot be loaded at the given address (so used a local copy); other minor changes.) |
|||
Line 2,875:
=={{header|Nim}}==
<lang nim>import
const DictFile = "unixdict.txt"
proc isSorted(s): bool =▼
var last = low(char)▼
for c in s:
if c < last: return false
last = c
var
for word in
if word.len >= mx and
if word.len > mx:
words
mx = word.len
words.add
echo words.join(" ")</lang>
{{out}}
<pre>abbott accent accept access accost almost bellow billow biopsy chilly choosy choppy effort floppy glossy knotty</pre>
|