ABC words: Difference between revisions

Content added Content deleted
Line 2,699: Line 2,699:
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 line in unixdict.split('\n') {
for word in unixdict.split('\n') {
if word.contains('a') && word.index_any('a') < word.index_any('b') && word.index_any('b') < word.index_any('c') {
if abc_word(line) == true {text += count++.str() + ': ' + line + '\n'}
text += count++.str() + ': ' + word + '\n'
}
}
}
println(text)
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}}
{{out}}
<pre>
<pre>