Permutations: Difference between revisions

m
→‎{{header|Perl 6}}: 'singularizer' not needed
m (→‎{{header|Generic version}}: updated so that it doesn't copy the set each time (but still records values to iterate over))
m (→‎{{header|Perl 6}}: 'singularizer' not needed)
Line 5,078:
 
=={{header|Perl 6}}==
{{works with|rakudo|2014-1-242018.10}}
First, you can just use the built-in method on any list type.
<lang Perl6>.say for <a b c>.permutations</lang>
Line 5,102:
my $s = $j + 1;
@a[ $r--, $s++ ] .= reverse while $r > $s;
return $(@a);
}
 
2,392

edits