I'm doing a bit of Blitz in my spare time, and have decided to write a Video Poker game.
When it comes to calculating whether you have a winning hand, and what that hand is, I'm a little confused.
Obviously I could go and write code for each individual possible hand, but that is far from efficient.
Say for instance I have - at the end of your hand being dealt - 5 strings, each of which contains the value of the card:
card_1_value = 12
card_2_value = 5
card_3_value = 14
card_4_value = 7
card_5_value = 14
The values I am using are as follows:
2 to 10 - self explanatory
Jack - 11
Queen - 12
King - 13
Ace - 14
How can I check these values and determine what poker hand I have? One pair, Two Pairs, Three of a kind, Flush, Straight, Full House, Straight Flush, Royal Flush are what I would like to check for.
If anyone can advise me, or point me in the right direction, I would be very grateful :)
Thanks!
When it comes to calculating whether you have a winning hand, and what that hand is, I'm a little confused.
Obviously I could go and write code for each individual possible hand, but that is far from efficient.
Say for instance I have - at the end of your hand being dealt - 5 strings, each of which contains the value of the card:
card_1_value = 12
card_2_value = 5
card_3_value = 14
card_4_value = 7
card_5_value = 14
The values I am using are as follows:
2 to 10 - self explanatory
Jack - 11
Queen - 12
King - 13
Ace - 14
How can I check these values and determine what poker hand I have? One pair, Two Pairs, Three of a kind, Flush, Straight, Full House, Straight Flush, Royal Flush are what I would like to check for.
If anyone can advise me, or point me in the right direction, I would be very grateful :)
Thanks!