Skip to content

Instantly share code, notes, and snippets.

View hayesmaker's full-sized avatar

hayesmaker hayesmaker

View GitHub Profile
@thefrontender
thefrontender / dealer.js
Created August 16, 2011 13:59
Javascript Dealer class for card games.
var Dealer = function (decks, suits, cards) {
var pack = [], // cards yet to be dealt (stock/shoe)
played = 0, // cards already dealt,
suitsLen,
cardsLen,
i,
j,
// Fisher-Yates shuffle - http://jsfromhell.com/array/shuffle