Anonymous user
Permutations: Difference between revisions
→{{header|Perl 6}}: borrow simplified code from dinesman
No edit summary |
(→{{header|Perl 6}}: borrow simplified code from dinesman) |
||
Line 1,046:
</pre>
=={{header|Perl 6}}==
<lang perl6>
my $j = @a.end - 1;
my $aj = @a[$j];
my $k = @a.end;
$k-- while
@a[ $j, $k ] .= reverse;
▲ $r--;
}
Output:<pre>
a c b
b a c
b c a
c a b
c b a
</pre>
|