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??
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.
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?
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.
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.