Poker program code




















Viewed 5k times. Improve this question. Cidricc Cidricc 1 1 silver badge 3 3 bronze badges. Your program needs many more functions, you have like 10 levels of indentation in just one function, it's really hard to understand the logic, which makes it reasonable that it does not work.

You don't check for full houses or straightflushes, and you don't check for high straights T-J-Q-K-A, only the low straights A Beyond that, it doesn't look like you included how you compute the parameters you pass into analyzeHand.

By the way, you don't have to reinvent the wheel. None of your functions except for main declare a return type Check your compiler settings; it should have warned you of all of these. Add a comment. Active Oldest Votes. Thread: C programming, Poker game C programming, Poker game I'm having trouble with a poker game. I was able to print out the correct hand straight, three of a kind, etc. And i just dont know where to start.

There are no suits when you are playing the game so please ignore any part of the code that has to do with suits. Also, if there is a way to input the players' cards into an array for each player and work the program like that i'd greatly appreciate it if anyone could help me out with that as well.

After a full house is the flush where you will use a while loop and an if statement. After a flush you will use a while loop and two if statements for both straights and three of a kind. You will then use a while loop and an if statement for both two pairs and two of a kind. Finally you will only need one if statement to determine if the player has just a high card. Now it is time to move onto the last and final step. The final step is to tell the player what their combination is.

To tell them their combination you will use println and System. The println will tell the player what their combination is, and the System. Did you make this project? Use the functions. For example, a function which turns the card of the highest value, among five values, then an other one which turns the one who is the second highest, then an other one for the third highest, etc It could help you order the values of the cards of a game.

Username Password min 6 characters Password again Email. Go to Sign Up By signing up or logging in, you agree to our Terms of service and confirm that you have read our Privacy Policy.

Poker game in C programming 1 Narmadha Restrictions: 1. The only authorized functions libC are printf and scanf. It is prohibited to use loops and while If you do not know what it is do not worry. Use functions. Stud Poker The stud poker takes place with a deck of 52 cards.

Here are the various combinations, classified in increasing order by value: 1. High card : None of the following combinations: 2. One pair : two cards of the same value. Two pairs : two times two cards of same value. Three of a kind : Three cards of the same value.

Flush color : Five cards of same color.



0コメント

  • 1000 / 1000