Words from neighbour ones: Difference between revisions

(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
Line 1,506:
</pre>
 
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">new_word_size = 9
well_sized = File.readlines("unixdict.txt", chomp: true).reject{|word| word.size < new_word_size}
well_sized.each_cons(new_word_size) do |slice|
candidate = (0...new_word_size).inject(""){|res, idx| res << slice[idx][idx] }
puts candidate if well_sized.include?(candidate)
end
</syntaxhighlight>
{{out}}
<pre>applicate
architect
astronomy
christine
christoph
committee
committee
committee
committee
committee
composite
constrict
constrict
construct
different
extensive
greenwood
implement
improvise
intercept
interpret
interrupt
interrupt
philosoph
prescript
receptive
telephone
transcend
transcend
transport
transpose
</pre>
=={{header|VBScript}}==
Run it in CScript.
1,149

edits