Find words with alternating vowels and consonants: Difference between revisions
Content added Content deleted
m (Prolog - removed unnecessary line) |
m (Swift - use forEach instead of for loop) |
||
Line 2,112: | Line 2,112: | ||
do { |
do { |
||
try String(contentsOfFile: "unixdict.txt", encoding: String.Encoding.ascii) |
|||
.components(separatedBy: "\n") |
|||
.filter{$0.count > 9 && alternatingVowelsAndConsonants(word: $0)} |
|||
for (n, word) in lines.filter( |
|||
.enumerated() |
|||
print |
.forEach{print(String(format: "%2d. %@", $0.0 + 1, $0.1))} |
||
} |
|||
} catch { |
} catch { |
||
print(error.localizedDescription) |
print(error.localizedDescription) |