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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Generating all 5-card hands
by merlyn (Sage) on May 18, 2005 at 16:03 UTC | |
by thor (Priest) on May 18, 2005 at 16:34 UTC | |
by Limbic~Region (Chancellor) on May 18, 2005 at 16:53 UTC | |
by Roy Johnson (Monsignor) on May 18, 2005 at 17:58 UTC | |
by Limbic~Region (Chancellor) on May 18, 2005 at 20:34 UTC | |
by thor (Priest) on May 18, 2005 at 18:26 UTC | |
by Limbic~Region (Chancellor) on May 18, 2005 at 20:37 UTC |