Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^2: Generating all 5-card hands

by Limbic~Region (Chancellor)
on Mar 31, 2006 at 20:30 UTC ( #540550=note: print w/replies, xml ) Need Help??

in reply to Re: Generating all 5-card hands
in thread Generating all 5-card hands

For generating all combinations of 52 cards taken 5 at a time....But are you really ready to process all 2598960 iterations? At 100 per second, that's still about a third of a day.

In cribbage, order is important contrary to what thor said earlier. The position of 1 card determines its eligibility for "right-jack" so there really are 12,994,800 hands that need to be considered. Even still, it is possible to both generate and score all those hands in under 15 minutes using pure perl. This would encompass everything thor wanted to do and a lot more.

Cheers - L~R

Replies are listed 'Best First'.
Re^3: Generating all 5-card hands
by thor (Priest) on Mar 31, 2006 at 22:40 UTC
    In cribbage, order is important contrary to what thor said earlier.
    While you're correct in that order matters, you and I are not disagreeing. My original problem was to prove that all hands that contained a 5 had at least two points. If knobs is obtained, then a jack was cut. With at least one 5 in the hand, this will yield 2 points for the fifteen, thus satisfying the original problem.


    The only easy day was yesterday

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://540550]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2019-04-24 13:18 GMT
Find Nodes?
    Voting Booth?
    I am most likely to install a new module from CPAN if:

    Results (121 votes). Check out past polls.