Jack Diederich wrote:
> You might want to look at a specific purpose library for poker hands:
> http://pokersource.sourceforge.net/
Nah, evaluating the poker hands is the FUN part! I want to do that myself :)
> If you really want to do combinations a C extension has already
> been written (by m
Hi all,
given a sequence of n elements i need to generate all possible
permutations of length k <= n.
I found an elegant way to do this recursively:
def comb(items, n):
if n==0: yield []
else:
for i in xrange(len(items)):
for cc in comb(items[i+1:],n-1):