[Kde-games-devel] KPoker again: Rule question

Inge Wallin inge at lysator.liu.se
Sat Aug 21 22:31:09 CEST 2004


The following is a part of the code in KPoker (from
Player::sortedResult()).  It tries to put a score on the hand of the
player (lower score is better):

 switch (result) {
	case 1 :
		newResult += 400; // one pair
		break;
  	case 2 :
		newResult += 350; // two pairs
		break;
  	case 3 :
		newResult += 300; // 3 of a kind
		break;
  	case 4 :
		newResult += 250; // full house
		break;
  	case 6 :
		newResult += 200; // 4 of a kind
		break;
  	case 7 :
		newResult = 150; // straight
		break;
  	case 8 :
		newResult += 100; // flush
		break;
  	case 9 :
		newResult += 50; // straight flush
		break;


Is this really correct?  I thought that 4 of a kind was better than both a
straight or a flush and not the other way around which is indicated by the
code above.

My belief was that the order was:
Straight flush, 4 of a kind, full house, flush, straight, 3 of a kind, two
pairs, pair, best card.

Am I wrong?

	-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