ABC words: Difference between revisions

Content added Content deleted
m (Automated syntax highlighting fixup (second round - minor fixes))
Line 3,003: Line 3,003:


=={{header|Vlang}}==
=={{header|Vlang}}==
<syntaxhighlight lang="vlang">import os
<syntaxhighlight lang="vlang">
import os


fn main() {
fn main() {
Line 3,009: Line 3,010:
mut text :=''
mut text :=''
unixdict := os.read_file('./unixdict.txt') or {panic('file not found')}
unixdict := os.read_file('./unixdict.txt') or {panic('file not found')}
for word in unixdict.split('\n') {
for word in unixdict.split_into_lines() {
if word.contains('a') && word.index_any('a') < word.index_any('b') && word.index_any('b') < word.index_any('c') {
if word.contains('a')
&& word.index_any('a') < word.index_any('b')
&& word.index_any('b') < word.index_any('c') {
text += count++.str() + ': $word \n'
text += count++.str() + ': $word \n'
}
}