Results 1 to 7 of 7

Thread: poker

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Leeds England
    Posts
    54

    poker

    ive made a poker game in vb, and ive got as far as the final hand of five cards, after the player has traded his/her cards. Now i wanna have the computer know what card is what?! and to recognice a winning hand! any suggestions??

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    How are your cards identified?
    If you have every card with two properties (number and color) you could do a number compare to find pairs, triples and pokers.
    To find a street, order the card numbers and see if they are in one row.
    A flush is found by color compare.
    Then you need to combine the things:
    pair + pair = double pair
    pair + triple = full house
    street + flush = straight flush (if highest, royal flush)
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Leeds England
    Posts
    54
    no the cards are not identified?! how do i do that?? all the conmputer knows is that it is displaying 5 picture boxes each with containing a .gif picture called something like acespades.gif or hearts3.gif etc. how do i set the cards some properties?

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Leeds England
    Posts
    54
    please help me?!! i need to know how to set these propeties to the cards? if i can do that ive cracked it!!

  5. #5
    Fanatic Member steve65's Avatar
    Join Date
    Jun 2000
    Posts
    610
    I would set up some type of array that holds the value of the card, it's suit, it's picture location, and it's location in the game (i.e. dealer's hand, discarded, player 1, 2, 3 or 4's hand).

    Once you set up this structure you should be able to then calculate your hands easily.
    This space for rent...

  6. #6

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Leeds England
    Posts
    54
    help! im confused by my own code! ive got a ton of code just for the deal button, to give the player his/hers initial 5 cards.
    could any one clean it up for me? and i need to alter it to recognise a winning hand.

    The code for the deal button and draw button is attached to this post.


    please help! im very new to vb!
    Attached Files Attached Files

  7. #7
    Fanatic Member steve65's Avatar
    Join Date
    Jun 2000
    Posts
    610
    I would take a look at this demo

    http://www.planet-source-code.com/vb...13251&lngWId=1

    It should give you a good idea how to go about making a card game.
    This space for rent...

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