Results 1 to 8 of 8

Thread: Poker game

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    2

    Poker game

    Hi,

    This really isn't a code specific quesiton, but this is probably the best place to post it. I started working on a poker game about a year ago, and I haven't worked on it in about 6 months or so. I probably won't have time to work on it soon, so I was wondering if anybody wanted to take a look at it. I will make the code freely available to anybody who wants. You can do anything you want with it from taking off from where I left off to just getting ideas from what I tried to do.

    The poker game itself is just regular five card draw, but the code could be rewritten for something else I suppose. I got it to do pretty much everything but AI, which I did have a few ideas for but never got around to adding. Anyway, it will deal two hands, one for the computer and one for the user. The user can then check, bet, or fold. If you check or bet you can click on the cards you want to get rid of and replace them with new (yes, non repeating) new cards. From there, you can bet or check again and then the computer's cards are displayed. All throughout this runtime, it can determine what you have in your hand such as a pair or straight and can determine whose hand is higher even if both have a pair for example. The computer does not bet or change cards yet, though. That is where I left off and is really all that need to be worked on other than various things here and there.

    So anyway, if anybody wants it, I'll post it along with a test application I wrote for changing the probabilties of getting three outputs (one of my AI ideas). I tried to document everything as best as I could.

  2. #2
    Hyperactive Member Arachnid13's Avatar
    Join Date
    Jan 2003
    Location
    England
    Posts
    327

    Re: Poker game

    hi, i have also been developing a poker game, texas holdem not 5 card but this sounds like it might be a help so if you could post the could that would b gr8
    Do you wake up in the morning feeling sleepy and grumpy? Then you must be Snow White

  3. #3
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    366

    Re: Poker game

    I am also working on a poker game, please could you tell me where i can find your coding so i can look at it, or do you email it personally.

    Thanks very much

    Alex

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    2

    Re: Poker game

    Hey, I completely forgot I posted this. I've attached everything here in four parts. Download them all and use winrar to decompress the first part. That will grab all the files from the other parts as well.

    There are three folders in there. The one labled test is a test application I wrote early on. It is extrememly basic and very poorly written. It was only used to test code for determining the weight of a hand (you'll get it if you run it). You don't really need it for anything because I cleaned up the code and put it in the actual poker application.

    The folder labled AItest is a program I wrote to control probablities for AI. That's about as far as I got with that part. Read the comments I wrote in the code.

    The folder labled Alpha1 is the actual poker application. Do whatever you want with it. Please just don't claim credit for the whole thing. There is a text file in that folder called key.txt. That should help you understand what I did a little more easily.

    Just as a note, this was written in vb.net. If you have any questions, let me know.
    Attached Files Attached Files

  5. #5
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    366

    Re: Poker game

    It wants to open in visual studio, is this right, how do i open it in visual basic?

    Thanks

    Alex

  6. #6
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    366

    Re: Poker game

    Ahh right, didn't read that vb.net bit. How can i modify the bit about how the computer knows what it has for visual basic. Or can i not...
    Thanks

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Poker game

    If you mean VB6 (or VB5/VBA), it is probably best to ignore VB.Net code - as it is very different.

  8. #8
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    366

    Re: Poker game

    Hi, I have found a visual basic poker game (link at bottom) that is not quite texas holdem but seems to be ablt to tell what hand the user has. If i upload it does someone think they can get rid of all the features and change it so it just displays in a text box or somethying what hand the user has. It has a lot of stuff like sounds that are not neccessary for what a lot of people on this forum seem to want - poker ai.
    Also if someone can get a moment, can anyone get the ai, to work out the probabilities of winning useing the method <213>>_Longhorn said in thread:
    http://www.vbforums.com/showthread.p...ighlight=poker
    [quote]
    For example, if you are dealt AA down what are the odds pre-flop of hitting a 3 of a kind? Since you have only seen 2 cards there are 50 possible left. Even though other people maybe at the table you don't know there cards and the next card could be any of the 50 left. There are 2 cards left you can catch out of that 50 to make a 3 of a kind, AA, so the odds are 2 / 50 or 1/25 or 4%. If the flop comes and no Ace is on the board then the odds are 2 / 47 possible left or 4.2%. If none comes on the turn, then the odds of you getting that Ace on the river are 2 / 48 or 4.2 % again. That will hold the same for any pocket pair the chance of hitting a set, or 3 of a kind, is about 4%.

    Going on a flush example, lets say you were dealt the A3 of hearts. The flop comes there is the 10H and 6H. That means out of the 13 hearts there are 4 gone, the A, 3, 6, 10 with the 2, 4, 5, 7, 8, 9, J, Q, K or 9 left. What are the odds of hitting the flop on the turn? There are 47 cards gone, and 9 can give you a flush or 9 / 47 or 19 %, the turn comes as a 3 clubs, what are the odds of hitting the flush on the river? 9 / 46 or 19.5%. Preflop the odds of hitting a flush are 11 /50 or 22%. Lets assume a player has the KH then you odds fall to 8 /47 or 17% after the flop. If somebody has the Q of hearts and the King is also gone then your odds are 7 / 47 15%. You could then have the program play WHAT-IFs
    [end quote]

    Thanks very much
    Alex

    The link to download the .zip is
    http://www.planet-source-code.com/vb...64833&lngWId=1

    It is 1 and a bit mB which is too big to upload to this forum...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width