PDA

Click to See Complete Forum and Search --> : poker


bradley252
Jan 24th, 2002, 11:28 AM
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??

CornedBee
Jan 24th, 2002, 01:25 PM
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)

bradley252
Jan 25th, 2002, 11:05 AM
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?

bradley252
Jan 29th, 2002, 10:01 AM
please help me?!! i need to know how to set these propeties to the cards? if i can do that ive cracked it!!

steve65
Jan 29th, 2002, 10:22 AM
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.

bradley252
Jan 29th, 2002, 10:34 AM
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!

steve65
Jan 29th, 2002, 11:26 AM
I would take a look at this demo

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=13251&lngWId=1

It should give you a good idea how to go about making a card game.