2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,4 +1,4 @@
|
|||
sub permute(@items) {
|
||||
sub permute(+@items) {
|
||||
my @seq := 1..+@items;
|
||||
gather for (^[*] @seq) -> $n is copy {
|
||||
my @order;
|
||||
|
|
@ -7,7 +7,7 @@ sub permute(@items) {
|
|||
$n div= $_;
|
||||
}
|
||||
my @i-copy = @items;
|
||||
take [ map { @i-copy.splice($_, 1) }, @order ];
|
||||
take map { |@i-copy.splice($_, 1) }, @order;
|
||||
}
|
||||
}
|
||||
.say for permute( 'a'..'c' )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue