Tijnema <[EMAIL PROTECTED]> wrote: Well, I find this a very interesting thing ;)
I have played quite a lot poker, and I still play it sometimes, and this doesn't seems too hard for me :) My approach would be this: 1) Deal cards, rand(1,13) for the numbers(1-> Ace, 11->Jack, 12->Queen, 13->King), and rand (1,4) for color(1-> spades, 2-> clubs, 3-> diamonds, 4->hearts) 2) Betting, with some buttons and AJAX to update pot etc. 3) Turn 4) Step 2 5) River 6) Step 2 7) Looping through all players and check what their highest combination is, take the 2 best combinations, and see if they are equal.If not, the highest wins of course, but if they are equal, check if number 3 has also same combination, and if so, check number 4, ... Now you have some players with same combination, and you need to sort the guys by highest cards in combination. If one has higher cards than all others, he won. If not, get only those guys that have the same highest cards in the combination, and check those guys for their kicker (only for Pair, Two pair, Three of a Kind, Four of a Kind). If their kicker is equal, or there combination isn't the one I noted, it's a split pot :) Not too hard to program right? Tijnema You need to add logic to ensure that the same card is not dealt twice! An initial routine to shuffle the deck is the approach that I would take. Stephen