[Purdue-pm] challenge problems: "xoker" hands

Mark Senn mark at purdue.edu
Fri Apr 1 20:33:27 PDT 2011


"Xoker" is "extended poker".  I just made that name up.
A possible challege problem for the May meeting is to compare
two xoker hands and print "1" or "2" for if the first
hand or second hand wins.

See
    http://www.pokerlistings.com/poker-hand-ranking
for poker hand ranking.  Xoker has the additioal rules
to rank hands.  See the rest of this message for
the additional rules.

(I'm wondering if it would be easier to have
Perl code figure this out directly or have Perl
code reads a rule set and uses that rule set
to do the real work.)

Suits are not ranked equally.  In decreasing
order of value:
    club
    diamond
    hearts
    spades

Xoker is played with one deck of the normal 52 cards.
After 10 cards are dealt (it's a two person game),
all the cards are shuffled before the next hand.

Each card has two parameters: a rank and a suit.  Ranks are
    2 3 4 5 6 7 8 9 10 j q k a
Suits are
    c d h s

Input to compare two hands is of the form, for example
    10c 8d ah 2s kd / 10s as ad 2h jd 7d
hand 1 is before the "/", hand 2 is after the "/".
Your program should do extensive error checking.

After the "One Pair" ranking but before the "High Card"
rankig insert:

    Rainbow: red card, black card, red card, black card, red card.
    Example: jh 8d 7d 4h ad (aces can be high or low)

    Bainbow: black card, red card, black card, red card, black card.
    Example: kc 10d 8c 5d 2s (aces can be high or low)

    Straight2: like a "Straight" except instead of adjacent cards it is
    "every other" card.
    Example: as qs 10d 8h 6d (aces can be high or low)

    Straight3: like a "Straight" except instead of adjacent cards it is
    "every third" card.
    Example: ks 10d 7d 4s ah

    Primes: Prime number cards.
    Example: 2s 3d 5h 7d jh
    Example: 3d 5h 7d jh kh

    Fibonacci: Fibonacci number cards, k 8 5 3 2 of any suit.
    Example: kc 8d 5d 3c 2c

Con you think of any other crazy rules to add?

-mark


More information about the Purdue-pm mailing list