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

Added Forth solution
(Added Forth solution)
Line 370:
15: telemeter
16: tennessee
</pre>
 
=={{header|Forth}}==
{{works with|Gforth}}
<lang forth>: e3 ( addr u -- ? )
0 { ecount }
0 do
dup c@ case
'a' of false endof
'e' of ecount 1+ to ecount true endof
'i' of false endof
'o' of false endof
'u' of false endof
true swap
endcase
invert if unloop drop false exit then
1+
loop
drop
ecount 3 > ;
 
256 constant max-line
 
: main
0 0 { count fd-in }
s" unixdict.txt" r/o open-file throw to fd-in
begin
here max-line fd-in read-line throw
while
here swap 2dup e3 if
count 1+ to count
count 2 .r ." . " type cr
else
2drop
then
repeat
drop
fd-in close-file throw ;
 
main
bye</lang>
 
{{out}}
<pre>
1. belvedere
2. dereference
3. elsewhere
4. erlenmeyer
5. evergreen
6. everywhere
7. exegete
8. freewheel
9. nevertheless
10. persevere
11. preference
12. referee
13. seventeen
14. seventeenth
15. telemeter
16. tennessee
</pre>
 
1,777

edits