Ordered partitions: Difference between revisions
→{{header|Perl 6}}: provisional fix
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: mark as broken) |
SqrtNegInf (talk | contribs) (→{{header|Perl 6}}: provisional fix) |
||
Line 1,561:
=={{header|Perl 6}}==
▲{{works with|niecza|2012-06}}
<lang perl6>sub partition(@mask is copy) {
my @op;
for @mask.kv -> $k, $v {
next unless $v;
temp @mask[$k] -= 1;
for partition @mask
@p[$k].push: $last;
@op.push: @p;
}
}
return @op;
}
{{out}}
<pre>[[1, 2],
[[1, 3],
[[2, 3],
[[1, 4],
[[2, 4],
[[3, 4],
=={{header|Phix}}==
|