Combinations with repetitions: Difference between revisions
→Concise recursive: Changed to Wren S/H
imported>Rowsety Moid (Add Acornsoft Lisp) |
(→Concise recursive: Changed to Wren S/H) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 4,037:
{{trans|Go}}
Produces results in no particular order.
<syntaxhighlight lang="
if (n == 0 ) return [[]]
if (lst.count == 0) return []
var r =
for (x in
var y = x.toList
y.add(lst[0])
Line 4,050 ⟶ 4,049:
}
System.print(
System.print(
{{out}}
Line 4,058 ⟶ 4,057:
220
</pre>
===Library based===
{{libheader|Wren-seq}}
{{libheader|Wren-perm}}
Produces results in lexicographic order.
<syntaxhighlight lang="
import "./perm" for Comb
|