Teacup rim text: Difference between revisions

m
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.map(&:join) if rotations.all?{|rot| grouped_by_size[rot.size].include? rot.join }
end
puts "", list + ":"
Line 1,992:
{{libheader|Wren-str}}
{{libheader|Wren-sort}}
<syntaxhighlight lang="ecmascriptwren">import "io" for File
import "./str" for Str
import "./sort" for Find
 
var readWords = Fn.new { |fileName|
9,490

edits