Permutations: Difference between revisions

m
m (→‎{{header|Sidef}}: updated code)
m (→‎{{header|Wren}}: Minor tidy)
Line 9,886:
===Recursive===
{{trans|Kotlin}}
<syntaxhighlight lang="ecmascriptwren">var permute // recursive
permute = Fn.new { |input|
if (input.count == 1) return [input]
Line 9,922:
{{libheader|Wren-math}}
Output modified to follow the pattern of the recursive version.
<syntaxhighlight lang="ecmascriptwren">import "./math" for Int
 
var input = [1, 2, 3]
Line 9,964:
===Library based===
{{libheader|Wren-perm}}
<syntaxhighlight lang="ecmascriptwren">import "./perm" for Perm
 
var a = [1, 2, 3]
9,482

edits