in reply to
Re: Generating all 5-card hands

in thread Generating all 5-card hands

*
But are you really ready to process all 2598960 iterations?
*

Nope. The number that you mention is 52-choose-5: the number of 5-card hands possible sans restrictions. I consider only those hands that have at least one 5 in them to be interesting. This takes out a significant portion (by my math, it leaves only 886656). I will further reduce the set by using the fact that a cribbage hand is inherently non-ordered and, for my purposes, suit doesn't matter. So, I'll not bother scoring a hand if I've already seen a hand with the same cards in it. I just did it in 30 seconds, generating 1820 distinct hands. :)

thor

`
Feel the white light, the light within`

Be your own disciple, fan the sparks of will

For all of us waiting, your kingdom will come