Jump to content

Ordered words: Difference between revisions

Added Arturo implementation
(add Standard ML)
(Added Arturo implementation)
Line 333:
{{output}}
<lang applescript>{"abbott", "accent", "accept", "access", "accost", "almost", "bellow", "billow", "biopsy", "chilly", "choosy", "choppy", "effort", "floppy", "glossy", "knotty"}</lang>
 
=={{header|Arturo}}==
 
<lang rebol>ordered?: function [w]->
w = join sort split w
 
words: read.lines relative "unixdict.txt"
ret: new []
loop words 'wrd [
if ordered? wrd ->
'ret ++ #[w: wrd l: size wrd]
]
 
sort.descending.by: 'l 'ret
maxl: get first ret 'l
print sort map select ret 'x -> maxl = x\l
'x -> x\w</lang>
 
{{out}}
 
<pre>abbott accent accept access accost almost bellow billow biopsy chilly choosy choppy effort floppy glossy knotty</pre>
 
=={{header|AutoHotkey}}==
1,532

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.