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

Content added Content deleted
(→‎{{header|REXX}}: added the computer programming language REXX.)
(strengthened testing for requirements.)
Line 4: Line 4:
Use the dictionary   [https://web.archive.org/web/20180611003215/http://www.puzzlers.org/pub/wordlists/unixdict.txt unixdict.txt]
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.
Find words which contains more than three   '''e'''   vowels   ''and''   contains only   '''e'''   vowels.
<br><br>
<br><br>


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. */
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*/
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 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? " " " */
if countstr(chrU, $) < many then iterate /*Have enough vowels? " " " */
finds= finds + 1 /*bump the count of "ABC" words found. */
finds= finds + 1 /*bump the count of "ABC" words found. */
Line 38: Line 42:
<pre>
<pre>
────────────────────────────── 25104 words in the dictionary file: unixdict.txt
────────────────────────────── 25104 words in the dictionary file: unixdict.txt
accelerometer
belvedere
belvedere
betelgeuse
centerpiece
cheerleader
cheesecake
decelerate
degenerate
dereference
dereference
desegregate
electroencephalogram
electroencephalograph
electroencephalography
elsewhere
elsewhere
entrepreneur
entrepreneurial
ephemerides
erlenmeyer
erlenmeyer
evergreen
evergreen
everywhere
everywhere
exegete
exegete
experience
eyepiece
freewheel
freewheel
genevieve
heterogeneity
heterogeneous
inexperience
interference
interferometer
interviewee
irredeemable
leeuwenhoek
minesweeper
nevertheless
nevertheless
perseverance
persevere
persevere
preference
preference
referee
referee
refereeing
reprehensible
representative
reverberate
seventeen
seventeen
seventeenth
seventeenth
speedometer
squeegee
steeplechase
teleconference
telemeter
telemeter
teletypesetting
teletypewrite
tennessee
tennessee
────────────────────────────── 16 "e" words found using the characters: 4 'e'
weatherbeaten
wheresoever
────────────────────────────── 55 "e" words found using the characters: 4 'e'
</pre>
</pre>