Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 surveying the Monastery: (6)
As of 2024-04-16 19:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found