(*** 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)
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.
Replaced tauchris@yahoo.com with null@kde.org due to bounces by reporter
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.
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.
maybe its the wrong winner because the game see only one pair instead of two. see bug#51140 and bug#70903
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
Looks like bug 51140 was also fixed by the patch.
*** Bug 138110 has been marked as a duplicate of this bug. ***