1 Attachment(s)
[VB6] Scoring Poker Hands
Using 8 bytes to represent a card
Maintain an array for the deck of cards
Shuffling the deck/array
Dealing from the deck to two arrays (players 1 and 2 cards in hand)
Generating permutation for the cards in hand
Determining the best hand through "weight" computations
Re: [VB6] Scoring Poker Hands
Moved to Games Programming CodeBank
1 Attachment(s)
Re: [VB6] Scoring Poker Hands
Thanks Hack. I didn't know there was a more appropriate subsection.
I've updated the code...
EDIT: and I've updated again. It now works properly for flush, straight flush and royal flush. Seems I forgot to update proc PrepHandArr() when I raised the 2nd dimension of the Hand() array. I corrected logical error in IsFlush() and IsStraight(). I also updated the GetHandName() proc.
Re: [VB6] Scoring Poker Hands
Quote:
Originally Posted by leinad31
Thanks Hack. I didn't know there was a more appropriate subsection.
I've updated the code...
No problem.
In keeping with this CodeBank policy, your attachment has been edited and the executable file that was included has been removed.
Please place ONLY source code in your attachments. No form of executables (.exe, .dll, .ocx, etc) are permitted, and will be removed.
Re: [VB6] Scoring Poker Hands
Sorry Hack, forgot to remove the exe.
I'll update this to a class when I have spare time.