Anonymous user
Find words which contains more than 3 e vowels: Difference between revisions
Find words which contains more than 3 e vowels (view source)
Revision as of 07:02, 9 February 2021
, 3 years agostrengthened testing for requirements.
(→{{header|REXX}}: added the computer programming language REXX.) |
(strengthened testing for requirements.) |
||
Line 4:
Use the dictionary [https://web.archive.org/web/20180611003215/http://www.puzzlers.org/pub/wordlists/unixdict.txt unixdict.txt]
Find words which contains more than three '''e''' vowels ''and'' contains only '''e''' vowels.
<br><br>
Line 25:
say copies('─', 30) # "words in the dictionary file: " iFID
finds= 0 /*count of the "eeee" words found. */
vowels= 'aeiou'; /*obtain the list of the other vowels. */
upper vowels /*uppercase all the other vowels. */
vowels= space( translate( vowels, , chrU), 0) /*elide the one particular vowel. */
do j=1 for #; $= @.j /*process all the words that were found*/
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
if countstr(chrU, $) < many then iterate /*Have enough vowels? " " " */
finds= finds + 1 /*bump the count of "ABC" words found. */
Line 38 ⟶ 42:
<pre>
────────────────────────────── 25104 words in the dictionary file: unixdict.txt
belvedere
dereference
elsewhere
erlenmeyer
evergreen
everywhere
exegete
freewheel
nevertheless
persevere
preference
referee
seventeen
seventeenth
telemeter
tennessee
▲────────────────────────────── 55 "e" words found using the characters: 4 'e'
</pre>
|