Odd words: Difference between revisions
Content added Content deleted
No edit summary |
m (→version 2, caseless: used more idiomatic code.) |
||
Line 713: | Line 713: | ||
if iFID=='' | iFID=="," then iFID='unixdict.txt' /* " " " " " " */ |
if iFID=='' | iFID=="," then iFID='unixdict.txt' /* " " " " " " */ |
||
@.= /*default value of any dictionary word.*/ |
@.= /*default value of any dictionary word.*/ |
||
do #=1 while lines(iFID)\==0 |
do #=1 while lines(iFID)\==0 /*read each word in the file (word=X).*/ |
||
x= strip( linein( iFID) ) |
x= strip( linein( iFID) ) /*pick off a word from the input line. */ |
||
$.#= x; upper x; |
$.#= x; upper x; @.x= . /*save: original case and the semaphore*/ |
||
end /*#*/ |
end /*#*/ /* [↑] semaphore name is uppercased. */ |
||
#= # - 1 /*adjust word count because of DO loop.*/ |
|||
#= # - 1 |
|||
minW= minL * 2 - 1 /*minimum width of a word to be usable.*/ |
minW= minL * 2 - 1 /*minimum width of a word to be usable.*/ |
||
say copies('─', 30) # "words in the dictionary file: " iFID |
say copies('─', 30) # "words in the dictionary file: " iFID |
||
Line 732: | Line 732: | ||
say right(left($.j, 20), 24) left(ow, 9) /*indent original word for readability.*/ |
say right(left($.j, 20), 24) left(ow, 9) /*indent original word for readability.*/ |
||
end /*j*/ |
end /*j*/ |
||
say copies('─', 30) ows ' "odd words" found with a minimum length of ' minL |
say copies('─', 30) ows ' "odd words" found with a minimum length of ' minL</lang> |
||
</lang> |
|||
{{out|output|text= when using the default input:}} |
{{out|output|text= when using the default input:}} |
||
<pre> |
<pre> |