Jump to content

How to start in poker?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Talo

Talo

    Newbie

  • Members
  • Pip
  • 4 posts
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.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
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.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Talo

Talo

    Newbie

  • Members
  • Pip
  • 4 posts
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.
#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;
}