Jump to content

ABC words: Difference between revisions

m
Line 2,699:
mut text :=''
unixdict := os.read_file('./unixdict.txt') or {panic('file not found')}
for lineword in unixdict.split('\n') {
if word.contains('a') && word.index_any('a') < word.index_any('b') && word.index_any('b') < word.index_any('c') {return true}
if abc_word(line) == true {text += count++.str() + ': ' + lineword + '\n'}
}
}
println(text)
}
</lang>
 
fn abc_word(word string) bool {
if word.contains('a') && word.index_any('a') < word.index_any('b') && word.index_any('b') < word.index_any('c') {return true}
return false
}
</lang>
{{out}}
<pre>
291

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.