Find words which contains all the vowels: Difference between revisions

Added solution for Action!
(Add Modula-2)
(Added solution for Action!)
Line 11:
{{Template:Strings}}
<br><br>
 
=={{header|Action!}}==
In the following solution the input file [https://gitlab.com/amarok8bit/action-rosetta-code/-/blob/master/source/unixdict.txt unixdict.txt] is loaded from H6 drive. Altirra emulator automatically converts CR/LF character from ASCII into 155 character in ATASCII charset used by Atari 8-bit computer when one from H6-H10 hard drive under DOS 2.5 is used.
<lang Action!>BYTE FUNC Once(CHAR ARRAY text CHAR c)
BYTE i,n
 
i=1 n=0
FOR i=1 TO text(0)
DO
IF text(i)=c THEN
n==+1
IF n>1 THEN
RETURN (0)
FI
FI
OD
IF n=1 THEN
RETURN (1)
FI
RETURN (0)
 
BYTE FUNC IsValidWord(CHAR ARRAY word)
IF word(0)<=10 THEN RETURN (0) FI
IF Once(word,'a)=0 THEN RETURN(0) FI
IF Once(word,'e)=0 THEN RETURN(0) FI
IF Once(word,'i)=0 THEN RETURN(0) FI
IF Once(word,'o)=0 THEN RETURN(0) FI
IF Once(word,'u)=0 THEN RETURN(0) FI
RETURN (1)
 
PROC FindWords(CHAR ARRAY fname)
CHAR ARRAY line(256)
CHAR ARRAY tmp(256)
BYTE pos,dev=[1]
 
pos=2
Close(dev)
Open(dev,fname,4)
WHILE Eof(dev)=0
DO
InputSD(dev,line)
IF IsValidWord(line) THEN
IF pos+line(0)>=39 THEN
PutE() pos=2
FI
Print(line) Put(32)
pos==+line(0)+1
FI
OD
Close(dev)
RETURN
 
PROC Main()
CHAR ARRAY fname="H6:UNIXDICT.TXT"
 
FindWords(fname)
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Find_words_which_contains_all_the_vowels.png Screenshot from Atari 8-bit computer]
<pre>
ambidextrous bimolecular cauliflower communicable communicate consanguine consultative countervail exclusionary
grandiloquent importunate incommutable incomputable insupportable loudspeaking malnourished mensuration
oneupmanship pandemonium permutation perturbation portraiture praseodymium stupefaction sulfonamide
</pre>
 
=={{header|Ada}}==
Anonymous user