Anonymous user
Word wheel: Difference between revisions
→{{header|REXX}}: added/changed some comments, simplified the final filter.
(→{{header|REXX}}: added/changed some comments, simplified the final filter.) |
|||
Line 765:
if iFID==''|iFID=="," then iFID= 'UNIXDICT.TXT' /* " " " " " " */
oMinL= minL; minL= abs(minL) /*if negative, then don't show a list. */
gridU= grid; upper gridU
Lg= length(grid); Hg= Lg % 2 + 1 /*get length of grid & the middle char.*/
wrds= 0 /*# words that are in the dictionary. */
wees= 0 /*" " " " too short. */
bigs= 0 /*" " " " too long. */
dups= 0 /*" " " " duplicates. */
ills= 0 /*" " " contain
good= 0 /*" " " contain center letter. */
say ' Reading the file: ' iFID
@.= . /*uppercase non─duplicated dict. words.*/
$= /*the list of dictionary words in grid.*/
do recs=
_= linein(iFID) /*read a word (line of text) from dict.*/
u= space(_, 0); upper u; L= length(u) /*elide superfluous blanks from a word.*/
Line 787:
@.u= /*signify that U is a dictionary word*/
wrds= wrds + 1 /*bump the number of "good" dist. words*/
if pos(
good= good + 1 /*bump # center─letter words in dict. */
if verify(u, gridU)\==0 then iterate /*word contains a letter not in grid. */
if
$= $ u /*add this word to the "found" list. */
end /*recs*/
Line 803:
say ' the minimum length of words that can be used: ' right( commas(minL), 9)
say ' the word wheel (grid) being used: ' grid
say ' center of the word wheel (grid) being used: ' right('↑', Hg
say; #= words($); $= strip($)
say ' number of word wheel words in the dictionary: ' right( commas(# ), 9)
Line 813:
lower: arg aa; @='abcdefghijklmnopqrstuvwxyz'; @u=@; upper @u; return translate(aa,@,@U)
commas: parse arg _; do jc=length(_)-3 to 1 by -3; _=insert(',', _, jc); end; return _
/*──────────────────────────────────────────────────────────────────────────────────────*/
do n=1
end /*n*/; return 0 /*signify that the AA passed the
{{out|output|text= when using the default inputs:}}
<pre>
|