Bug 30272 - Error picking winner when both players have 2-pair hands
Summary: Error picking winner when both players have 2-pair hands
Status: RESOLVED FIXED
Alias: None
Product: kpoker
Classification: Applications
Component: general (show other bugs)
Version: 0.7
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Andreas Beckermann
URL:
Keywords:
: 138110 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-08-05 02:03 UTC by Unknown
Modified: 2007-01-07 00:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tauchris 2001-08-05 01:58:50 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kpoker
Version:           0.7 (using KDE 2.1.1 )
Severity:          normal
Installed from:    Red Hat Linux 6.2
Compiler:          gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
OS:                Linux 2.2.19-6.2.1enterprise i686
OS/Compiler notes: 

Playing a 2-player poker game where the second player is the computer.  I have a 2-pair hand Jacks over nines.  The computer has a 2-pair hand also Aces over threes.  The game says *I* won.  Aces-over should beat Jacks-over however.  So the game is wrong.

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 Jacco 2002-10-25 06:19:17 UTC
I can confirm this one: I have 2 jacks and 2 fours, computer has 2 tens and 2 
fives and the computer wins. Which it shouldn't, as jacks beat tens.
Comment 2 Stephan Kulow 2004-05-19 10:41:20 UTC
Replaced tauchris@yahoo.com with null@kde.org due to bounces by reporter
Comment 3 jeronimo vicente farias 2004-07-22 18:05:40 UTC
it's same for me.  i have 2-Aces and 2-fours, the computer have 2-Jacks and 2-nines, then the computer wins.  it's wrong, because Aces beat Jacks.  
Comment 4 Inge Wallin 2004-08-21 21:58:50 UTC
I have looked at the code, and the bug is indeed there.  The program only checks the winner by adding the scores for the cards.  This works for almost all combinations, but not for two pairs and I believe not for a full hand.  I will look into the problem and try to fix it, if I am allowed by the maintainers.
Comment 5 Mathieu Jobin 2004-08-22 01:42:43 UTC
maybe its the wrong winner because the game see only one pair instead of two.
see bug#51140 and bug#70903
Comment 6 Inge Wallin 2004-08-26 23:00:06 UTC
CVS commit by ingwa: 

Completely rewrite of the valuation of a poker hand.  This patch fixes
all valuation bugs as far as I know, and it is tested pretty
thoroughly.  I played so much that I managed to once get four Aces(!)
and once a straight flush(!!).  Never got a royal flush, though.

There are still a couple of debug messages left for other testers than
me.  I will remove them in a few days.

Refer to bug 30272 - Error picking winner when both players have 2-pair hands 
Refer to bug 70903 - kpoker identifies only one pair
Refer to bug 71693 - all cards are blinking (computer have just two pairs) 

CCMAIL: 30272-done@bugs.kde.org
CCMAIL: 70903-done@bugs.kde.org
CCMAIL: 71693-done@bugs.kde.org


  M +28 -2     kpaint.cpp   1.23
  M +51 -0     kpoker.cpp   1.72
  M +0 -17     kpoker.h   1.33
  M +521 -18   player.cpp   1.14
  M +193 -9    player.h   1.9
  M +6 -1      playerbox.cpp   1.10
  M +30 -0     testers.cpp   1.7



Comment 7 Inge Wallin 2004-08-26 23:20:24 UTC
Looks like bug 51140 was also fixed by the patch.
Comment 8 Dirk Rathlev 2007-01-07 00:57:07 UTC
*** Bug 138110 has been marked as a duplicate of this bug. ***