> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/o/ordered_words.md).

# Ordered words

```ruby
var words = [[]]
var file = %f'unixdict.txt'

file.open_r(\var fh, \var err) ->
    || die "Can't open file #{file}: $#{err}"

fh.each { |line|
    line.trim!
    if (line == line.sort) {
        words[line.length] := [] << line
    }
}

say words[-1].join(' ')
```

#### Output:

```
abbott accent accept access accost almost bellow billow biopsy chilly choosy choppy effort floppy glossy knotty
```
