Work Continues
I have added all the basic types of hands now, but am missing high card, and there is only calculation for kicker done currently on two pairs.
The maximum value a given hand for score is now 141,414,141,414. I've gone over the logic many times and I think that this system for score will cover all the possiblities. If not I may have to rework the way score works at a later date.
Determining which hands wins the hand will be done as such. First, the types of hands are ranked from top to bottom, with straight flush being the highest valued hand, and high card being the lowest.
The logic works as such: All hands face off, the highest type hand wins outright, if there are two or more hands with the same hand type, that is the point that it goes to the score.
I was going to incorporate the hand type into the score, but looking at it I think I would require too long of a integer, also this sort of locks me into always combining those two values into score, and there may be some reason to split them in the future.
Each card is assigned a value equal to its Rank 2=2points, 3=3points, .. King=13points, Ace=14 points.
If two or more hands have the same hand type (ie: Two Pair) then we go to a showdown based upon score. Every hand has a top card which is always worth more than the bottom card. In the case of two pair, the top (highest) card is multiplied by 10,000,000,000 and is added to the score. So if someone had 4's versus someone else's 3's, they would have a score of 40,000,000,000 versus 30,000,000,000.
Lets say they both have 2's as their second card, since 2's is the low card in the two pair scenario, we only multiply it by 100,000,000.
This leaves us with 40,200,000,000 and 30,200,000,000 for scores.
Aces and Queens versus Aces and Kings. 141,200,000,000 < 141,300,000,000
When we go to add the first kicker, the first kicker will occupy the 5th, and 6th position of our 141,414,141,414 numbers.
Ace/King with a Jack Kicker versus Ace/King with a 10 Kicker.
141,311,000,000 > 141,310,000,000
I think this works for all scenarios of two pair.
Things are going well so far, many more things need to be done but the algorythyms for determining the score value of hands, which will be used to determine the winner of the hands are well underway.
The maximum value a given hand for score is now 141,414,141,414. I've gone over the logic many times and I think that this system for score will cover all the possiblities. If not I may have to rework the way score works at a later date.
Determining which hands wins the hand will be done as such. First, the types of hands are ranked from top to bottom, with straight flush being the highest valued hand, and high card being the lowest.
The logic works as such: All hands face off, the highest type hand wins outright, if there are two or more hands with the same hand type, that is the point that it goes to the score.
I was going to incorporate the hand type into the score, but looking at it I think I would require too long of a integer, also this sort of locks me into always combining those two values into score, and there may be some reason to split them in the future.
Each card is assigned a value equal to its Rank 2=2points, 3=3points, .. King=13points, Ace=14 points.
If two or more hands have the same hand type (ie: Two Pair) then we go to a showdown based upon score. Every hand has a top card which is always worth more than the bottom card. In the case of two pair, the top (highest) card is multiplied by 10,000,000,000 and is added to the score. So if someone had 4's versus someone else's 3's, they would have a score of 40,000,000,000 versus 30,000,000,000.
Lets say they both have 2's as their second card, since 2's is the low card in the two pair scenario, we only multiply it by 100,000,000.
This leaves us with 40,200,000,000 and 30,200,000,000 for scores.
Aces and Queens versus Aces and Kings. 141,200,000,000 < 141,300,000,000
When we go to add the first kicker, the first kicker will occupy the 5th, and 6th position of our 141,414,141,414 numbers.
Ace/King with a Jack Kicker versus Ace/King with a 10 Kicker.
141,311,000,000 > 141,310,000,000
I think this works for all scenarios of two pair.
Things are going well so far, many more things need to be done but the algorythyms for determining the score value of hands, which will be used to determine the winner of the hands are well underway.

0 Comments:
Post a Comment
<< Home