Anagrams: Difference between revisions
Content deleted Content added
m →{{header|REXX}}: corrected a misspelling. |
|||
Line 5,622: | Line 5,622: | ||
else if #>most then do; $=_; most=#; if len>ww then ww=len; end |
else if #>most then do; $=_; most=#; if len>ww then ww=len; end |
||
end /*while*/ /*$ ◄── list of high count anagrams. */ |
end /*while*/ /*$ ◄── list of high count anagrams. */ |
||
say '─────────────────────────' uw " |
say '─────────────────────────' uw "usable words in the dictionary file: " iFID |
||
say |
say |
||
do m=1 for words($); z=subword($, m, 1) /*the high count of the anagrams. */ |
do m=1 for words($); z=subword($, m, 1) /*the high count of the anagrams. */ |
||
Line 5,628: | Line 5,628: | ||
end /*m*/ /*W is the maximum width of any word.*/ |
end /*m*/ /*W is the maximum width of any word.*/ |
||
say |
say |
||
say '───── Found' words($) "words (each of which have" words( |
say '───── Found' words($) "words (each of which have" words(!.z)-1 'anagrams).' |
||
exit /*stick a fork in it, we're all done. */ |
exit /*stick a fork in it, we're all done. */ |
||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
||
Line 5,642: | Line 5,642: | ||
{{out|output|text= when using the default input (dictionary):}} |
{{out|output|text= when using the default input (dictionary):}} |
||
<pre> |
<pre> |
||
───────────────────────── 24819 |
───────────────────────── 24819 usable words in the dictionary file: unixdict.txt |
||
abel [anagrams: able bale bela elba] |
abel [anagrams: able bale bela elba] |
||
Line 5,670: | Line 5,670: | ||
else if #>most then do; $=_; most=#; if len>ww then ww=len; end |
else if #>most then do; $=_; most=#; if len>ww then ww=len; end |
||
end /*while*/ /*$ ◄── list of high count anagrams. */ |
end /*while*/ /*$ ◄── list of high count anagrams. */ |
||
say '─────────────────────────' uw " |
say '─────────────────────────' uw "usable words in the dictionary file: " iFID |
||
say |
say |
||
do m=1 for words($); z=subword($, m, 1) /*the high count of the anagrams. */ |
do m=1 for words($); z=subword($, m, 1) /*the high count of the anagrams. */ |
||
Line 5,676: | Line 5,676: | ||
end /*m*/ /*W is the maximum width of any word.*/ |
end /*m*/ /*W is the maximum width of any word.*/ |
||
say |
say |
||
say '───── Found' words($) "words (each of which have" words( |
say '───── Found' words($) "words (each of which have" words(!.z)-1 'anagrams).' |
||
exit /*stick a fork in it, we're all done. */ |
exit /*stick a fork in it, we're all done. */ |
||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
/*──────────────────────────────────────────────────────────────────────────────────────*/ |