I need help to pass class please!!!

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
Last edited on
closed account (48T7M4Gy)
I can help you do it. We'll do it in parts. That'll be 10 bucks thanks.
closed account (37oyvCM9)
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!! ...
Last edited on
closed account (37oyvCM9)
Hey Kermot can ya have a look at my post in beginners it titled Help ptr** driving me crazy...or something like that
closed account (48bpfSEw)
https://github.com/donnemartin/poker
All i need is to write the card numbers and suits in 7 times and output what the best possible hand is
closed account (37oyvCM9)
If thats all you should have it in no time ;).. Think you might be underestimating how much code checking hand values is though lol.
i dont know how to do this at all so i need someone to do it for me
Necip how does gitbuh work??????
closed account (48bpfSEw)
click on "download" button and compile the source code
closed account (48T7M4Gy)
Zurcee, has someone turned your computer on for you?
Topic archived. No new replies allowed.