Jump to content

ABC words: Difference between revisions

m
→‎{{header|REXX}}: used more idiomatic code.
m (→‎{{header|REXX}}: adjusted the record count.)
m (→‎{{header|REXX}}: used more idiomatic code.)
Line 660:
if iFID=='' | iFID=="," then iFID='unixdict.txt' /* " " " " " " */
@.= /*default value of any dictionary word.*/
do #=1 while lines(iFID)\==0 /*read each word in the file (word=X).*/
x= strip( linein( iFID) ) /*pick off a word from the input line. */
$.#= x; upper x; @.#= x /*save: original case. */
end /*#*/ /* [↑] semaphore name is uppercased. */
#= # - 1 ABCs= ABCs + 1 /*bumpadjust theword count because of "ABC"DO words foundloop. */
say copies('─', 30) #-1 "words in the dictionary file: " iFID
L = length(chrs) /*obtain the length of the ABC chars.*/
chrsU= chrs; upper chrsU /*obtain an uppercase version of chrs.*/
ABCsfinds= 0 /*count of the "ABC" words found. */
do j=1 for #-1 /*process all the words that were found*/
if verify(chrsU, @.j)>0 then iterate /*All characters found? No, then skip.*/
p= 0 /*initialize the position location. */
Line 676 ⟶ 677:
p= _ /*save the position of the last letter.*/
end /*k*/
 
ABCs= ABCs + 1 /*bump the count of "ABC" words found. */
finds= finds + 1 /*bump the count of "ABC" words found. */
say right(left($.j, 30), 40) /*indent original word for readability.*/
end /*j*/
 
say copies('─', 30) ABCs finds ' "ABC" words found using the characters: ' chrs</lang>
{{out|output|text=&nbsp; when using the default input:}}
<pre>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.