Thread: Designing a program to deal out seven card stud poker hands

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    9

    Designing a program to deal out seven card stud poker hands

    How would I go about doing this? I know nothing about programming at all. The program will need to deal out thousands if not millons of hands.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    You should probably look at shuffle algorithms. Dealing cards off the top of the deck should be straightforward.

  3. #3
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    Quote Originally Posted by killsthehorse View Post
    How would I go about doing this? I know nothing about programming at all. The program will need to deal out thousands if not millons of hands.
    How many decks of cards does it take to deal out a million hands?
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by dudeomanodude View Post
    How many decks of cards does it take to deal out a million hands?
    That's why you shuffle.

  5. #5
    Registered User
    Join Date
    Dec 2008
    Posts
    9
    Quote Originally Posted by dudeomanodude View Post
    How many decks of cards does it take to deal out a million hands?
    I dont know nothing about this but am willing to learn. What I want to do is to take a situation in a seven card stud poker game and deal out enough hands to give me a probability of what will occur.

  6. #6
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    Yea, I was just wondering what the difference between dealing out thousands or millions of hands was...

    EDIT: Ah, now I see...

    If you want an odds calculator, I think you should be tackling this from a different angle. You're approaching this from a "Monte Carlo" method, which seems a bit cumbersome.
    Last edited by dudeomanodude; 12-07-2008 at 11:10 PM.
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  7. #7
    Registered User
    Join Date
    Dec 2008
    Posts
    9
    Quote Originally Posted by dudeomanodude View Post
    Yea, I was just wondering what the difference between dealing out thousands or millions of hands was...
    I just need to deal out a decent enough of hands to get a close estimation of what will happen. The more hands dealt the better.

  8. #8
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    Yea, sure, you can do it that way to get your distribution as accurate as you can (this is Monte Carlo). But I don't think you need to approach it this way. Google Poker odds and start from there...
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  9. #9
    Registered User
    Join Date
    Dec 2008
    Posts
    9
    Quote Originally Posted by dudeomanodude View Post
    Yea, I was just wondering what the difference between dealing out thousands or millions of hands was...

    EDIT: Ah, now I see...

    If you want an odds calculator, I think you should be tackling this from a different angle. You're approaching this from a "Monte Carlo" method, which seems a bit cumbersome.
    Whats the best way to approach this?

  10. #10
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    By building an odds calculator and not a simulation
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  11. #11
    Registered User
    Join Date
    Dec 2008
    Posts
    9
    Quote Originally Posted by dudeomanodude View Post
    Yea, sure, you can do it that way to get your distribution as accurate as you can (this is Monte Carlo). But I don't think you need to approach it this way. Google Poker odds and start from there...
    This just gives me down loadable texas holdem poker odd calculators.

  12. #12
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    okay, let me try to clarify.

    Really good poker players know the odds when they play (this is what makes them so great). Sure they have the experience of having played thousands of poker hands in their life time, but that's not why they know the odds.

    There's no need to deal out thousands or millions of hands to get a better approximation of what the odds are.

    There's some mathematical formulas behind poker odds. Find out what those are, and build your calculator based on those formulas.
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  13. #13
    Registered User
    Join Date
    Dec 2008
    Posts
    9
    Quote Originally Posted by dudeomanodude View Post
    okay, let me try to clarify.

    Really good poker players know the odds when they play (this is what makes them so great). Sure they have the experience of having played thousands of poker hands in their life time, but that's not why they know the odds.

    There's no need to deal out thousands or millions of hands to get a better approximation of what the odds are.

    There's some mathematical formulas behind poker odds. Find out what those are, and build your calculator based on those formulas.
    lol how do good players know the odds? By doing simulations such as what i am doing or playing thousands of hands and recalling what works more often. Thanks for the advice.

  14. #14
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    I suppose you never read any of doyle brunson's books huh? (Neither have I), but I've skimmed through them and he teaches you exactly what I'm suggesting, how to know the odds. Yes, good poker players (like the ones you see on tv) know the odds. Obviously, they don't know what the other player's odds are, but you bet they know their own (they know it exactly, the same as they show next to their cards on the tv). Yes, they know it that well. So what difference does it make for your purposes? Once you knwo how to calculate the odds for one player (or hand), you know how to do it for 7 players, a million players, a million hands.
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  15. #15
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    This is just a math problem, not a computer problem.

    You've got a shuffled deck.
    It's 1/2 that the top card is red.
    It's 1/4 that it's a club
    It's 1/13 that it's an ace

    You just rank the winning hands (Hand A beats Hand B, because A is statistically rarer). This is given in the rules of the game. If you look hard enough, you should find the actual probabilities as well.

    > This just gives me down loadable texas holdem poker odd calculators.
    Well they were derived mathematically as well.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Card shuffle and deal want to put on Stack
    By sugie in forum C++ Programming
    Replies: 4
    Last Post: 12-12-2005, 08:40 PM
  2. Replies: 11
    Last Post: 10-24-2004, 10:28 AM
  3. Cribbage Game
    By PJYelton in forum Game Programming
    Replies: 14
    Last Post: 04-07-2003, 10:00 AM
  4. Need help with program for class
    By zakelua in forum C++ Programming
    Replies: 2
    Last Post: 01-02-2003, 03:39 PM
  5. Please Help w/ Messy Poker Program
    By ray in forum C++ Programming
    Replies: 1
    Last Post: 12-16-2002, 08:59 PM