Ordered words: Difference between revisions
Content added Content deleted
(→{{header|AppleScript}}: Minor modification to match change to recommended sort.) |
m (→{{header|REXX}}: optimized the REXX program, changed comments and whitespace, used a template for the output section.) |
||
Line 3,472:
<lang rexx>/*REXX program lists (the longest) ordered word(s) from a supplied dictionary. */
iFID= 'UNIXDICT.TXT' /*the filename of the word dictionary. */
call linein iFID, 1, 0 /*point to the first word in dictionary*/
do j=1 while lines(iFID)\==0;
w= length(x); if w<
parse upper var x xU 1 z
do k=2
if
end /*k*/ /* [↑] logic includes ≥ order. */
@.w= @.w x
end /*j*/
#= words(@.
say # 'word's(#) "found (of length"
do n=1 for #; say word(@.
exit /*stick a fork in it, we're all done. */
ghijk
/*──────────────────────────────────────────────────────────────────────────────────────*/
s: if arg(1)==1 then return ''; return "s" /*a simple pluralizer (merely adds "S")*/</lang>
<pre>
16 words found (of length 6)
|