PDA

View Full Version : Poker Fun!



MJH
11-14-2009, 02:00 PM
1) CODE TITLE: Poker Fun!

2) AUTHOR NAME/NOTES: Michael J. Hill www.javascript-demos.com

3) DESCRIPTION: Deals 1 to 8 hands, of 1 to 7 cards each, then displays the name of each hand's best rank, e.g., Pair of 8's, Full House 9's over K's.

Several configuration variables are available:



var nHands = 5; // number of players - 8 maximum, (an octagon table);
var perHand = 7; // 1 to 7 cards;
var nDecks = 3; // you may use a "shoe" of several decks;
var dealPace = .075 // a new card is dealt every n seconds;

// the next two variables may be either true or false, no quotes;

var rotateDealer = true; // if true, each player, in succession, becomes the dealer;
var toEndOfDeck = true; // continue to deal until not enough cards remain, then shuffle a new deck / shoe;


4) URL TO CODE: http://www.javascript-demos.com/poker/Poker_Demo.html

jscheuer1
11-14-2009, 04:54 PM
I'm not sure if this is for the DD library or not, though that's not my decision to make. However, it is pretty cool IMO. And I was impressed in that your demo page worked fine in Opera, often authors neglect that browser because their coding style is too IE/Firefox centric. I don't know if you specifically tested for Opera, but obviously your coding style in this case is broad enough to support it.

djr33
11-14-2009, 09:09 PM
I think it is interesting as well, but I don't really see a function for it. Unless you want to practice counting cards (or maybe learn what the different hands are called), it isn't interactive or a tool that users could do something with.

If it were possible to make it a little more interactive (maybe actually playing/betting), this would be more generally appealing.

For example, you could just hide the other hands and give the user a starting number of chips (let's say 5). Then he plays against the computer's other hands and ends up winning/losing chips.
Of course the current mode could still be an option.