Odd words: Difference between revisions

m
→‎{{header|Ruby}}: improved somewhat
m (→‎{{header|Ruby}}: improved somewhat)
Line 1,410:
 
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">dict = File.readlines("unixdict.txt",each chomp:do true).reject{|w| w.size < 5}
next if w.size < 9
dict.each do |w|
odd = w.chars.each_slice(2).map(&:first).join
puts [w.ljust(14), odd].join(" ") if w.size > 8 && dict.include?(odd)
end</syntaxhighlight>
{{out}}
Line 1,431:
terminable trial
</pre>
 
=={{header|Rust}}==
<syntaxhighlight lang="rust">use std::collections::BTreeSet;
1,149

edits