Changeable words: Difference between revisions

m
→‎{{header|REXX}}: elided a programming note and use of an ordered alphabet for changing letters. .
m (added whitespace, removed the forcing of the placement of the __TOC__.)
m (→‎{{header|REXX}}: elided a programming note and use of an ordered alphabet for changing letters. .)
Line 549:
 
It also allows the minimum length to be specified on the command line (CL) as well as the dictionary file identifier.
 
 
Programming note:   the alphabet   (used to change any letter)   is ordered by the highest frequency of use.
<lang rexx>/*REXX program finds changeable words (within an identified dict.), changing any letter.*/
parse arg minL iFID . /*obtain optional arguments from the CL*/
Line 564 ⟶ 561:
say copies('─', 30) # "words in the dictionary file: " iFID
finds= 0 /*count of the changeable words found.*/
abc= 'etaoinshrdlcumwfgypbvkjxqzabcdefghijklmnopqrstuvwxyz'; upper abc /*alphabet ordered by frequency of use.*/
Labc= length(abc) /*the length of the alphabet to be used*/
 
Line 572 ⟶ 569:
x= $.j; upper x /*get an uppercased version of the word*/
pad= left('', 9) /*PAD: used for indenting the output.*/
do k=1 for L; y= substr(x, k, 1) /*yY: the current letter being changed.*/
do c=1 for Labc /* [↓] change the _ letter to another.*/
?= substr(abc, c, 1) /*get a new char to replace one in word*/