Anonymous user
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
x= strip( linein( iFID) )
$.#= x; upper x; @.#= x
end /*#*/
say copies('─', 30) #
L = length(chrs) /*obtain the length of the ABC chars.*/
chrsU= chrs; upper chrsU /*obtain an uppercase version of chrs.*/
do j=1 for #
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)
{{out|output|text= when using the default input:}}
<pre>
|