Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

(jeffa) Re: Parens permutations

by jeffa (Bishop)
on Aug 02, 2003 at 23:28 UTC ( [id://280359]=note: print w/replies, xml ) Need Help??


in reply to Parens permutations

Interesting problem ... this is as far as i got before giving up. I borrowed some of merlyn's code from Permutations and combinations:
for my $row (combinations(1..3)) { my @row = 1..3; $row[$_-1] = "($row[$_-1])" for @$row; print "@row\n"; } # from [id://24270] by [merlyn] sub combinations { return [] unless @_; my $first = shift; my @rest = combinations(@_); return @rest, map { [$first, @$_] } @rest; } __END__ 1 2 3 1 2 (3) 1 (2) 3 1 (2) (3) (1) 2 3 (1) 2 (3) (1) (2) 3 (1) (2) (3)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://280359]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2024-04-23 10:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found