Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: All possible number combinations in perl

by brx (Pilgrim)
on Jun 10, 2012 at 08:24 UTC ( [id://975390]=note: print w/replies, xml ) Need Help??


in reply to Re: All possible number combinations in perl
in thread All possible number combinations in perl

perl -e 'for my $i (1 .. (2<<4)-1){(1&($i>>$_)) && print 1+$_," " for +0..4; print"\n"} ' 1 2 1 2 3 1 3 2 3 1 2 3 4 1 4 2 4 1 2 4 3 4 1 3 4 2 3 4 1 2 3 4 5 1 5 2 5 1 2 5 3 5 1 3 5 2 3 5 1 2 3 5 4 5 1 4 5 2 4 5 1 2 4 5 3 4 5 1 3 4 5 2 3 4 5 1 2 3 4 5

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-03-28 16:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found