Word wheel: Difference between revisions

Content added Content deleted
(→‎{{header|Raku}}: Add a Raku example)
m (→‎{{header|Factor}}: remove unused vocabularies)
Line 134: Line 134:
=={{header|Factor}}==
=={{header|Factor}}==
{{works with|Factor|0.99 2020-07-03}}
{{works with|Factor|0.99 2020-07-03}}
<lang factor>USING: assocs assocs.extras combinators.short-circuit grouping
<lang factor>USING: assocs io.encodings.ascii io.files kernel math
math.statistics prettyprint sequences sorting ;
io.encodings.ascii io.files kernel math math.statistics
prettyprint sequences sets sorting ;


! Only consider words longer than two letters and words that
! Only consider words longer than two letters and words that
Line 143: Line 142:
[ [ member? ] keep length 2 > and ] with filter ;
[ [ member? ] keep length 2 > and ] with filter ;


: words ( input-str path -- words )
: words ( input-str path -- seq )
[ [ midpoint@ ] keep nth ] [ ascii file-lines pare ] bi* ;
[ [ midpoint@ ] keep nth ] [ ascii file-lines pare ] bi* ;