Re: Problem 054
Posted: Fri Aug 24, 2012 5:01 pm
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.
A website dedicated to the puzzling world of mathematics and programming
https://projecteuler.chat/
In such a case, someone is definitely cheating if playing with a 52-card deck!!!If both hands are three-of-a-kind, first compare the three-of-a-kind; if equal, ....
Actually, that's not necessarily true. Imagine this:rayfil wrote:In such a case, someone is definitely cheating if playing with a 52-card deck!!!If both hands are three-of-a-kind, first compare the three-of-a-kind; if equal, ....![]()
![]()
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.SoboLAN wrote:Actually, that's not necessarily true. Imagine this:rayfil wrote:In such a case, someone is definitely cheating if playing with a 52-card deck!!!If both hands are three-of-a-kind, first compare the three-of-a-kind; if equal, ....![]()
![]()
Player 1: Ad Ts
Player 2: Td 7h
Board: 5s Th 8d 3s Tc
Both players have three-of-a-kind (tens).
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.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.
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...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.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).
If you PM me your results for the 1000 hands, one per line in order, I will point out the first wrong one.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..
No. For the purpose of this problem, Ace is high (only).gothxx wrote:It's not stated if 5♠ 4♦ 3♦ 2♠ A♥ is considered a straight or not. Anyone?
thx, realised just that i could just try, and it worked!thundre wrote:No. For the purpose of this problem, Ace is high (only).gothxx wrote:It's not stated if 5♠ 4♦ 3♦ 2♠ A♥ is considered a straight or not. Anyone?
Maybe you are parsing it incorrectly. I just downloaded the latest from the website and I get, as expected: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.
Code: Select all
>wc -l p054_poker.txt
1000 p054_poker.txt