Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: (Golf) Ordered Combinations

by sachmet (Scribe)
on Apr 25, 2001 at 01:42 UTC ( #75279=note: print w/ replies, xml ) Need Help??


in reply to (Golf) Ordered Combinations

51 :-)

#!/usr/bin/perl sub c {my$n=-1+shift;$n?map{my$c=$_;map$c.$_,c($n,@_)}@_:@_}; sub d {my$n=shift;--$n?map{my$d=$_;map$d.$_,d($n,@_)}@_:@_}; print join " ", c qw(2 a b c); print "\n"; print join " ", d qw(2 a b c); print "\n"; print join " ", c qw(4 0 1); print "\n"; print join " ", d qw(4 0 1); print "\n";


Comment on Re: (Golf) Ordered Combinations
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-07-25 02:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls