Combinations with repetitions: Difference between revisions

→‎Concise recursive: Changed to Wren S/H
m (→‎Concise recursive: Minor tidy)
(→‎Concise recursive: Changed to Wren S/H)
 
(One intermediate revision by the same user not shown)
Line 4,037:
{{trans|Go}}
Produces results in no particular order.
<syntaxhighlight lang="ecmascriptwren">var Combrep = Fn.new { |n, lst|
if (n == 0 ) return [[]]
if (lst.count == 0) return []
Line 4,062:
{{libheader|Wren-perm}}
Produces results in lexicographic order.
<syntaxhighlight lang="ecmascriptwren">import "./seq" for Lst
import "./perm" for Comb
 
9,479

edits