i need to create a program that will figure out the best 5 card hand out of 7 playing cards. The program need to read 7 card inputs like this
Enter Card Number:
Enter Card Suit:
this program will calculate what the best possible hand is in that suit. The order will be as followed
High Card
One Pair
Two Pair
Three of a Kind
Straight
Flush
Four of a Kind
Straight Flush
Royal Flush
The Program needs to print the resulting name of hand.
If someone can help me do this and it works perfect i will pay you $20 via pay pal code needs to be clean. Teacher didnt teach us a single bit this year and left us to work on our own i have no clue how to do this so please help <3
Im doing this at the moment lol a poker game that is.
I have done it by making two arrays to check values of cards...
one array is called int checkSuitValues[NUM_OF_SUITS] and it loops through the array of cards and counts how many of each suit there is....so position checkSuitValues[0] counts the hearts and so on...this makes you able to check for flushes.
and the other array is called int checkFaceValues[NUM_OF_FACES] and it loops through the array of cards and counts how many of each face card there is....so position checkFaceValues[0] counts the number of twos and so on...this makes you able to check for high card, pair, two pair, three of a kind, fullhouse, four of a kind.
depending on how you have set up your cards....I set mine up with a struct with face,suit, and value so that not only could I have a card but I could have a number to keep track so...you can sort your array from lowest to highest and get your straights.
then you can combine last one with first one for straight flush....royal flush is straight flush anyway....
you need to set up kickers by the way so for instance...if you have a high card, pair, two pair and three of a kind you need to have kickers..so the next highest card that is not any of the above that will be kicker1, you need to have 3 of these in order to get a true win....
Cant think of anything else at the moment ....good luck!! ...