Ordered partitions: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: Fix link and comment: Perl 6 --> Raku) |
||
Line 1,679: | Line 1,679: | ||
Code 2: Recursive solution. |
Code 2: Recursive solution. |
||
{{trans| |
{{trans|Raku}} |
||
<lang perl>use List::Util 1.33 qw(sum pairmap); |
<lang perl>use List::Util 1.33 qw(sum pairmap); |
||
Line 1,719: | Line 1,719: | ||
</pre> |
</pre> |
||
The set of ordered partitions is not returned in lexicographical order itself; but it's supposed to be a set so that's hopefully okay. (One could sort the output before printing, but (unlike in |
The set of ordered partitions is not returned in lexicographical order itself; but it's supposed to be a set so that's hopefully okay. (One could sort the output before printing, but (unlike in Raku) Perl's built-in sort routine cannot meaningfully compare arrays without being passed a custom comparator to do that, which is a little messy and thus omitted here.) |
||
=={{header|Phix}}== |
=={{header|Phix}}== |