G
Guest
Guest
Hello,
I am writing a program for a 4 card poker game that will utilize a ranking system for cards.
I need some assistance in generating equivalences for hands that are equal in value.
For instance: If my hand consists of 2clubs 3spades 4diamonds 5hearts, that would be considered a straight, but would be equal in value to a hand that consists of 2diamonds, 3diamonds, 4hearts, 5spades.
For my ranking system I first want to calculate how many equivalent hands there are per category.
The following are hands that are broken down into categories from best hand to worst hand.
This is a 4 card poker hand and we are using a standard 52 card deck:
4 of a kind
Straight Flush
3 of a kind
Straight
Flush
2 Pair
Pair
High Card
Here is what I have so far:
4 of a Kind: This is pretty straightforward. There are 13 different ranks per deck, and since the hand consists of all 4 of a kind, there are 13 ways to make a 4 of a kind, and all 13 ways are unique.
Straight Flush: There are 11 ways to make a straight, from A K Q J through 4 3 2 A. There are 4 different suits, making 4*11 = 44 ways to make a straight flush. Now since A K Q J of all hearts is equal to A K Q J of diamonds, we consider them equal in value and hence there is only 11 unique values for a straight flush.
3 of a kind: This is the point where I need someone to point me in the right direction. There are 13 ranks and you choose 1 of those ranks. Out of the 4 cards of the chosen rank, you choose 3 of them to make the 3 of a kind. The remaining card has 12 different rank possibilities and you choose 1 of them. That remaining card also has 4 different suit possibilities and you choose 1 of them. Giving you (13choose1)*(4choose3)*(12choose1)*(4choose1) = 2496 ways to make a 3 of a kind.
To find equivalent hands, I assumed that everything was the same except that suits do not matter. So you have 13 ranks choose 1 and 12 remaining ranks choose 1, since suits do not matter I get (13choose1)*(12choose1) = 156 unique values for a 3 of a kind?
Does that math seem to make any sense? I am a little confused as to my approach for 3 of a kind, straight, flush, 2 pair, pair and high card equivalences.
Any help is greatly appreciated.
Thank you.
I am writing a program for a 4 card poker game that will utilize a ranking system for cards.
I need some assistance in generating equivalences for hands that are equal in value.
For instance: If my hand consists of 2clubs 3spades 4diamonds 5hearts, that would be considered a straight, but would be equal in value to a hand that consists of 2diamonds, 3diamonds, 4hearts, 5spades.
For my ranking system I first want to calculate how many equivalent hands there are per category.
The following are hands that are broken down into categories from best hand to worst hand.
This is a 4 card poker hand and we are using a standard 52 card deck:
4 of a kind
Straight Flush
3 of a kind
Straight
Flush
2 Pair
Pair
High Card
Here is what I have so far:
4 of a Kind: This is pretty straightforward. There are 13 different ranks per deck, and since the hand consists of all 4 of a kind, there are 13 ways to make a 4 of a kind, and all 13 ways are unique.
Straight Flush: There are 11 ways to make a straight, from A K Q J through 4 3 2 A. There are 4 different suits, making 4*11 = 44 ways to make a straight flush. Now since A K Q J of all hearts is equal to A K Q J of diamonds, we consider them equal in value and hence there is only 11 unique values for a straight flush.
3 of a kind: This is the point where I need someone to point me in the right direction. There are 13 ranks and you choose 1 of those ranks. Out of the 4 cards of the chosen rank, you choose 3 of them to make the 3 of a kind. The remaining card has 12 different rank possibilities and you choose 1 of them. That remaining card also has 4 different suit possibilities and you choose 1 of them. Giving you (13choose1)*(4choose3)*(12choose1)*(4choose1) = 2496 ways to make a 3 of a kind.
To find equivalent hands, I assumed that everything was the same except that suits do not matter. So you have 13 ranks choose 1 and 12 remaining ranks choose 1, since suits do not matter I get (13choose1)*(12choose1) = 156 unique values for a 3 of a kind?
Does that math seem to make any sense? I am a little confused as to my approach for 3 of a kind, straight, flush, 2 pair, pair and high card equivalences.
Any help is greatly appreciated.
Thank you.