Card Dealer
Last updated
Last updated
A robust card-dealing JavaScript Class written in TypeScript
Use any card deck with the Dealer
class
Shuffle deck into a random order
Draw cards for use
Discard cards without revealing them
Cut the deck
Included Decks
Standard 52 Playing Cards
Uno
Dealer()
takes a deck of cards to use for a game & places it on the draw pile.
Randomizes the dealer's draw pile order using the Fisher-Yates shuffle algorithm.
Cuts the deck at the specified position in the deck, moving the bottom half to the top of the draw pile.
Returns the number of cards requested from the draw pile for use in the game.
Moves the number of cards specified from the draw pile to the discard pile without revealing the value to the game.
Resets the draw & discard piles to the default deck position.
Returns a count for the remaining cards in the draw pile.