Find words with alternating vowels and consonants: Difference between revisions
Content deleted Content added
Added Wren |
Added AWK |
||
Line 88:
verisimilitude
67 words of alternating vowels and consonants found
</pre>
=={{header|AWK}}==
<lang awk>( length( $1 ) >= 10 ) \
{
# have an appropriate length word
word = $1;
haveVowel = word ~ /^[aeiou]/;
isAlternating = 1;
for( wPos = 2; isAlternating && wPos <= length( word ); wPos ++ )
{
hadVowel = haveVowel;
haveVowel = substr( word, wPos, 1 ) ~ /^[aeiou]/;
isAlternating = ( hadVowel && ! haveVowel ) || ( ! hadVowel && haveVowel );
} # for wPos
if( isAlternating )
{
printf( " %16s%s", word, ( alternatingCount % 6 == 5 ) ? "\n" : "" );
alternatingCount += 1;
} # if isAlternating
}
END \
{
printf( "\n%d words with alternating vowels and consonants found\n", alternatingCount );
} # END</lang>
{{out}}
<pre>
aboriginal apologetic bimolecular borosilicate calorimeter capacitate
capacitive capitoline capitulate caricature colatitude coloratura
colorimeter debilitate decelerate decolonize definitive degenerate
deliberate demodulate denominate denotative deregulate desiderata
desideratum dilapidate diminutive epigenetic facilitate hemosiderin
heretofore hexadecimal homogenate inoperative judicature latitudinal
legitimate lepidolite literature locomotive manipulate metabolite
nicotinamide oratorical paragonite pejorative peridotite peripatetic
polarimeter recitative recuperate rehabilitate rejuvenate remunerate
repetitive reticulate savonarola similitude solicitude tananarive
telekinesis teratogenic topologize unilateral unimodular uninominal
verisimilitude
67 words with alternating vowels and consonants found
</pre>
|