Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Number Combinations With Replacement

by lemming (Priest)
on Apr 18, 2002 at 19:30 UTC ( [id://160315]=note: print w/replies, xml ) Need Help??


in reply to Number Combinations With Replacement

Wouldn't feeding the permute function with like arguments give what you want? print "[", join(", ", @$_), "]\n" for permute([1,2], [1,2]);has this for output:

[1, 1] [1, 2] [2, 1] [2, 2]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 04:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found