Find words with alternating vowels and consonants: Difference between revisions
Content deleted Content added
→{{header|Haskell}}: Output split into columns. Ormolu applied to source. |
|||
Line 585: | Line 585: | ||
main :: IO () |
main :: IO () |
||
main = |
main = |
||
readFile "unixdict.txt" |
readFile "unixdict.txt" |
||
mapM_ putStrLn |
>>= mapM_ putStrLn |
||
((:) |
. ( ((:) . (<> " matching words:\n") . show . length) |
||
<*> inColumns 4 |
|||
) |
|||
. filter isLongAlternator |
|||
. lines |
|||
------------------------ FORMATTING ---------------------- |
|||
inColumns :: Int -> [String] -> [String] |
|||
inColumns n xs = unwords <$> chunksOf n (justifyLeft w ' ' <$> xs) |
|||
where |
|||
w = maximum (length <$> xs) |
|||
justifyLeft :: Int -> Char -> String -> String |
|||
justifyLeft n c s = take n (s <> replicate n c)</lang> |
|||
{{Out}} |
{{Out}} |
||
<pre>67 matching words: |
<pre>67 matching words: |
||
aboriginal apologetic bimolecular borosilicate |
|||
aboriginal |
|||
calorimeter capacitate capacitive capitoline |
|||
apologetic |
|||
capitulate caricature colatitude coloratura |
|||
bimolecular |
|||
colorimeter debilitate decelerate decolonize |
|||
borosilicate |
|||
definitive degenerate deliberate demodulate |
|||
calorimeter |
|||
denominate denotative deregulate desiderata |
|||
capacitate |
|||
desideratum dilapidate diminutive epigenetic |
|||
capacitive |
|||
facilitate hemosiderin heretofore hexadecimal |
|||
capitoline |
|||
homogenate inoperative judicature latitudinal |
|||
capitulate |
|||
legitimate lepidolite literature locomotive |
|||
caricature |
|||
manipulate metabolite nicotinamide oratorical |
|||
colatitude |
|||
paragonite pejorative peridotite peripatetic |
|||
coloratura |
|||
polarimeter recitative recuperate rehabilitate |
|||
colorimeter |
|||
rejuvenate remunerate repetitive reticulate |
|||
debilitate |
|||
savonarola similitude solicitude tananarive |
|||
decelerate |
|||
telekinesis teratogenic topologize unilateral |
|||
decolonize |
|||
unimodular uninominal verisimilitude</pre> |
|||
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</pre> |
|||
=={{header|Julia}}== |
=={{header|Julia}}== |