iterator? way of generating all possible combinations?
Raymond Hettinger
python at rcn.com
Sat May 27 00:50:53 EDT 2006
akameswaran at gmail.com wrote:
> Ok, this is really irritating me. I'm sure there are different ways of
> doing this - I'm interested in the algo, not the practical solution,
> I'm more trying to play with iterators and recursion. I want to create
> a program that generates every possible combination of a set of a n
> dice, with s sides.
. . .
> Any ideas? or better terms to google? cuz I've tried.
There are several interesting tidbits in the ASPN Cookbook:
http://aspn.activestate.com/ASPN/search?query=combinations§ion=PYTHONCKBK&type=Subsection
http://tinyurl.com/frxqz
Raymond
More information about the Python-list
mailing list