Find words which contains more than 3 e vowels: Difference between revisions

Content added Content deleted
(strengthened testing for requirements.)
m (→‎{{header|REXX}}: changed some comments.)
Line 25: Line 25:
say copies('─', 30) # "words in the dictionary file: " iFID
say copies('─', 30) # "words in the dictionary file: " iFID
finds= 0 /*count of the "eeee" words found. */
finds= 0 /*count of the "eeee" words found. */
vowels= 'aeiou'; /*obtain the list of the other vowels. */
vowels= 'aeiou' /*obtain the list of all the vowels. */
upper vowels /*uppercase all the other vowels. */
upper vowels /*uppercase all the other vowels. */
vowels= space( translate( vowels, , chrU), 0) /*elide the one particular vowel. */
vowels= space( translate( vowels, , chrU), 0) /*elide the one vowel we're looking for*/


do j=1 for #; $= @.j /*process all the words that were found*/
do j=1 for #; $= @.j /*process all the words that were found*/
upper $ /*uppercase it for caseless finds. */
upper $ /*uppercase it for caseless finds. */
if pos(chrU, $)==0 then iterate /*At least 1 vowel found? No, then skip*/
if verify(vowels, $, 'M')>0 then iterate /*Does it contain other vowels? Skip it*/
if verify(vowels, $, 'M')>0 then iterate
if countstr(chrU, $) < many then iterate /*Does it have enough of 'e's? " "*/
if countstr(chrU, $) < many then iterate /*Have enough vowels? " " " */
finds= finds + 1 /*bump count of only "e" vowels found. */
finds= finds + 1 /*bump the count of "ABC" words found. */
say right(left(@.j, 30), 40) /*indent original word for readability.*/
say right(left(@.j, 30), 40) /*indent original word for readability.*/
end /*j*/
end /*j*/