Page 3 of 4

Re: Problem 054

Posted: Fri Aug 24, 2012 5:01 pm
by TheEvil
Yes it is true. But lot's of other possibilities don't occur. If you could find that, you must be able to solve the problem.

Re: Problem 054

Posted: Fri Aug 24, 2012 8:25 pm
by rayfil
If both hands are three-of-a-kind, first compare the three-of-a-kind; if equal, ....
In such a case, someone is definitely cheating if playing with a 52-card deck!!! :( :shock: :lol:

Re: Problem 054

Posted: Sat Aug 25, 2012 9:46 am
by SoboLAN
rayfil wrote:
If both hands are three-of-a-kind, first compare the three-of-a-kind; if equal, ....
In such a case, someone is definitely cheating if playing with a 52-card deck!!! :( :shock: :lol:
Actually, that's not necessarily true. Imagine this:

Player 1: Ad Ts
Player 2: Td 7h
Board: 5s Th 8d 3s Tc

Both players have three-of-a-kind (tens).

Re: Problem 054

Posted: Sat Aug 25, 2012 10:38 am
by TheEvil
SoboLAN wrote:
rayfil wrote:
If both hands are three-of-a-kind, first compare the three-of-a-kind; if equal, ....
In such a case, someone is definitely cheating if playing with a 52-card deck!!! :( :shock: :lol:
Actually, that's not necessarily true. Imagine this:

Player 1: Ad Ts
Player 2: Td 7h
Board: 5s Th 8d 3s Tc

Both players have three-of-a-kind (tens).
This is a different kind of poker, where you have five cards in your hands, and no one on the table. What you are suggesting is an another game, and it has nothing to do with this exercise, and rayfil was talking about this particular problem.

Re: Problem 054

Posted: Sun Aug 26, 2012 2:51 am
by mdean
TheEvil wrote:
This is a different kind of poker, where you have five cards in your hands, and no one on the table. What you are suggesting is an another game, and it has nothing to do with this exercise, and rayfil was talking about this particular problem.
To be fair, the problem states nowhere what type of poker is being played, that a card cannot appear in both hands, or even that we're playing with a 52-card deck. Still, it doesn't change much.

Re: Problem 054

Posted: Sun Aug 26, 2012 8:36 am
by SoboLAN
TheEvil wrote:
SoboLAN wrote: Actually, that's not necessarily true. Imagine this:

Player 1: Ad Ts
Player 2: Td 7h
Board: 5s Th 8d 3s Tc

Both players have three-of-a-kind (tens).
This is a different kind of poker, where you have five cards in your hands, and no one on the table. What you are suggesting is an another game, and it has nothing to do with this exercise, and rayfil was talking about this particular problem.
You are talking about Draw (the poker variant with 5 cards in the hand and no card on board), but ... that was not what I was talking about. Look at what I wrote: each player with 2 cards and 5 cards on the board. How is that not Texas Hold'em ? Actually, if you look at it, the problem doesn't state what poker variant is played, because it doesn't really matter. In every one of them, the combinations are of 5 cards...

Anyway, I think this argument is not going to help anyone. I'm sorry I started it. I wish you good luck in solving problems :) .

Re: Problem 054

Posted: Mon Aug 27, 2012 1:38 pm
by Loers
can some one help me with my code ??
i finished coding everything and treated alot of tricks but still giving me a wrong answer..

Re: Problem 054

Posted: Mon Aug 27, 2012 5:27 pm
by thundre
Loers wrote:can some one help me with my code ??
i finished coding everything and treated alot of tricks but still giving me a wrong answer..
If you PM me your results for the 1000 hands, one per line in order, I will point out the first wrong one.

Re: Problem 054

Posted: Mon Aug 27, 2012 6:00 pm
by Loers
thanx in advance ^^ I sent the file..

Re: Problem 054

Posted: Sun Dec 16, 2012 10:11 pm
by Yamaneko
I've been trying to find the error in my code for days now and I just can't wrap my head around it. I'm using Python; I analyze the cards in a player's hand and check if they match the criteria for a "poker pattern" (as I came to call them), then give the player his score based on the rank of their pattern.
Unit tests give expected results for the individual hands, and everything seems to be in order with hands that I checked manually. I even removed those hands where both players had the same pattern (like if they both had only a pair of kings, which means the next highest card would decide) and evaluated them manually. Could someone give me a hint where I might be going wrong? I am seriously out of ideas. :-?

Re: Problem 054

Posted: Sun Dec 16, 2012 11:39 pm
by TheEvil
If you want, you can send me a list of your results, and I will give you the first wrong row. Or if you are misunderstanding something, it can be easier, if I make it clear in Hungarian.

Re: Problem 054

Posted: Mon Dec 17, 2012 11:47 am
by Yamaneko
Thanks! I sent you my results. :)

Re: Problem 054

Posted: Tue Dec 18, 2012 2:05 pm
by Yamaneko
Aaand... done! :)

Re: Problem 054

Posted: Fri Feb 14, 2014 4:16 pm
by gothxx
It's not stated if 5♠ 4♦ 3♦ 2♠ A♥ is considered a straight or not. Anyone?

Re: Problem 054

Posted: Fri Feb 14, 2014 7:13 pm
by thundre
gothxx wrote:It's not stated if 5♠ 4♦ 3♦ 2♠ A♥ is considered a straight or not. Anyone?
No. For the purpose of this problem, Ace is high (only).

Re: Problem 054

Posted: Sat Feb 15, 2014 12:46 am
by gothxx
thundre wrote:
gothxx wrote:It's not stated if 5♠ 4♦ 3♦ 2♠ A♥ is considered a straight or not. Anyone?
No. For the purpose of this problem, Ace is high (only).
thx, realised just that i could just try, and it worked! :D

Re: Problem 054

Posted: Sat Apr 19, 2014 5:21 pm
by DeatH_StaR
What is 'T'? I know what is 'J', 'Q', 'K' and 'A', but what is 'T'?

Re: Problem 054

Posted: Sat Apr 19, 2014 6:45 pm
by nicolas.patrois
Ten.

Re: Errors/Warnings/Bugs

Posted: Fri Apr 03, 2015 1:58 pm
by tdk.001
Has the input text file in Problem 54: Poker Hands changed without updating the answer?

The p054_poker.txt file I pulled has 1001 entries in it when the problem description says 1000, and similarly, my answer was off by one from what was expected.

Re: Errors/Warnings/Bugs

Posted: Fri Apr 03, 2015 2:10 pm
by mpiotte
tdk.001 wrote:Has the input text file in Problem 54: Poker Hands changed without updating the answer?

The p054_poker.txt file I pulled has 10001 entries in it when the problem description says 1000, and similarly, my answer was off by one from what was expected.
Maybe you are parsing it incorrectly. I just downloaded the latest from the website and I get, as expected:

Code: Select all

>wc -l p054_poker.txt 
1000 p054_poker.txt