Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Deuces Wild

Jack Lambert
Registered User
Join date: 4 Jun 2004
Posts: 265
08-29-2004 12:29
Hi guys,

I'm writing a Dueces Wild video poker game and I wonder if someone can help me out a little 'cause I can't seem to get my head round how I can make all the 2s be "whatever is most beneficial to the player."

My deck is a list 0-51 and a hand is a list of 5 of those. In the deck list, 0-12 are clubs from two (0) to ace (12), 13-25 are diamonds, 26-38 are hearts, 39-51 are spades.

An example hand may be:

list hand = [0, 10, 11, 12, 14];

Which would effectively be a [2C, JC, QC, KC, 2D]
Obviously, in this situation, a wild 2C should be 10C and a wild 2D should be an AC to make a royal flush.

At the moment I assign a value to each of the cards from 2 to 14

2 = 2
3 = 3
4 = 4
5 = 5
6 = 6
7 = 7
8 = 8
9 = 9
10 = 10
J = 11
Q = 12
K = 13
A = 14

So I have a list with a hand, and a function that determines a card's number value of 2-14 from any card in the deck (0-51).
With this combination, I can tell a straight, a flush, pairs, full house, etc.

Can anyone think of a way to make the value of a 2 equal to the most beneficial hand for the player without cycling through every possible combination of hands?

Right now, the function organizes the hand list from least to greatest (to check for straights) and then a for loop cycles through each card in the hand checking for pair combinations.

Any help would really be appreciated. When I am finished, I will make the hand checking function open source.

--Jack Lambert
Antagonistic Protagonist
Zeta
Join date: 29 Jun 2003
Posts: 467
08-29-2004 23:51
Haven't played with it myself (yet), but here is one person's adventures in poker hand evaluation with wildcards. You may or may not find it useful :/

http://www.howtodothings.com/showarticle.asp?article=217

-AP