[Kde-games-devel] KPoker and the card images

Inge Wallin inge at lysator.liu.se
Wed Aug 25 23:08:19 CEST 2004


Hi again,

I am now done writing a PokerHand class that handles all aspekts of (guess
what...) a Poker hand.  This will ultimately be used to fix bug 30272, a
misevaluation of several different hands.  However, when i tested it, very
strange things happened.

I traced the problems to the fact that the cards that I thought I had,
were not the ones that got displayed.  Then I looked at the card decks
(image files) in libkdegames and got very surprised by the order in which
they were stored.

Card "1.png" is the Ace of Clubs, "2.png" was the Ace of Spades, and so
on.  Card "52.png" is two of diamonds.  Some questions:

1. Why this order for the suits?  The order of the suits, as far as I
know, clubs, diamonds, spades and hearts in increasing order.

2. Why this order of ranks?  Why have the best cards using the lowest
indices?  Wouldn't the other way around be more intuitive?

3. Is this a standard order that is defined anywhere?  If so, where?

4. Wouldn't some other card classes than just images be a good addition to
libkdegames?  I have written a few for this project that I can brush up
and then let you look at and decide if it is a good idea.

	-Inge


Inge Wallin               | Thus spake the master programmer:               |
                          |      "After three days without programming,     |
inge at lysator.liu.se       |       life becomes meaningless."                |
                          | Geoffrey James: The Tao of Programming.         |


More information about the kde-games-devel mailing list