Hello,
I'm kinda new to the forums :). Been lurking for some days now though. I'm a newbie C++ programmer and my I've set my goals to some kind of Poker application. I don't know GUI yet so it would be console based.
So my question is, what would I need to understand?
What C++ topics should I understand?
How should I start? Because the idea of poker is simple but it's a complicated game! And I'm not even talking about a computer controlled character.
I was thinking; Create a "deck" and deal cards to the player and remove them from the deck (so I wont deal the same cards again) play some rounds and see who won.
Can I get your opinion about this? What do I need to learn to be able to do this?
PS: I'm talking about texas hold 'em.
How to start in poker?
Started by Talo, Jun 22 2009 06:00 AM
2 replies to this topic
#1
Posted 22 June 2009 - 06:00 AM
|
|
|
#2
Posted 22 June 2009 - 07:25 AM
Start with something simple: create a deck of cards and shuffle them. Then display the cards in shuffled order.
Once you have that working, add the ability to deal n cards to m players, and the ability to deal cards to the center (river?).
Once you have that working, add logic to handle money pools and betting.
Once you have that working, add the ability to deal n cards to m players, and the ability to deal cards to the center (river?).
Once you have that working, add logic to handle money pools and betting.
#3
Posted 23 June 2009 - 04:24 AM
Ok thanks for the hints :).
This is what I got so far, I'm not stuck or anything (yet) I just want to show my progress.
This is what I got so far, I'm not stuck or anything (yet) I just want to show my progress.
#include <iostream>
using namespace std;
int deck; // the deck
int main()
{
for(deck=0; deck <= 52; deck++) // display cards
cout << deck << endl;
cout << "<dealer shuffles>" << endl;
srand((unsigned)time(0));
for(deck=0; deck <= 52; deck++)
{
deck = (rand()%14)+1; //between 1 and 14 (1-10 + jack, queen, king, ace)
cout << deck << endl;
}
cout << "Ok, done." << endl;
return 0;
}


Sign In
Create Account

Back to top









