Teacup rim text: Difference between revisions
m
→{{header|Wren}}: Minor tidy
(→{{header|Ruby}}: Add Ruby) |
m (→{{header|Wren}}: Minor tidy) |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1,805:
=={{header|Ruby}}==
"woordenlijst.txt" is a Dutch wordlist. It has 413125 words > 2 chars and takes about two minutes.
<syntaxhighlight lang="ruby">lists = ["unixdict.txt", "wordlist.10000", "woordenlijst.txt"]
Line 1,815:
next unless chars.none?{|c| c < chars.first }
next if chars.uniq.size == 1
rotations = word.size.times.map {|i| chars.rotate(i).join }
rotations
end
puts "", list + ":"
Line 1,992:
{{libheader|Wren-str}}
{{libheader|Wren-sort}}
<syntaxhighlight lang="
import "./str" for Str
import "./sort" for Find
var readWords = Fn.new { |fileName|
|