chance-deck
Chance.js mixin for deck (playing cards) related functions
Install
npm install -S chance chance-deck
Usage
// initialize chance instanceconst chance = ; // add this module as mixinconst chance_deck = ;chance; // profitchance/*{ '0': [ '🂺', '🃈', '🃉', '🂭', '🃍', '🂫', '🃑', '🃇', '🂥', '🂸', '🃕', '🂷', '🃁' ], '1': [ '🃔', '🃖', '🃅', '🃎', '🂨', '🂡', '🃗', '🃊', '🂲', '🂤', '🂦', '🃄', '🂩' ], '2': [ '🃛', '🃋', '🃒', '🂾', '🃆', '🂵', '🃞', '🃃', '🂶', '🃘', '🂱', '🂣', '🂴' ], '3': [ '🃝', '🃙', '🂹', '🂳', '🃚', '🂪', '🃂', '🂮', '🂧', '🂽', '🂻', '🂢', '🃓' ]}*/ chance;/*{ '0': [ '🃖', '🂽', '🃈', '🂢', '🂡' ], '1': [ '🃘', '🂷', '🂶', '🃃', '🃝' ], '2': [ '🃍', '🃆', '🂨', '🂣', '🃑' ], stock: [ '🃕', '🂪', '🂱', '🃁', ... ] // remaining cards}*/ // you can distribute anything with `deal()`chance;/*{ '0': [ 'n', 'g', 'o', 'm', 'e', 'd', 'p', 'k' ], '1': [ 'v', 't', 'j', 'c', 'f', 'w', 'u', 'i' ], '2': [ 'a', 'y', 'l', 'q', 'z', 'b', 'x', 'h' ], stock: [ 's', 'r' ]}*/ // you can also use the built-in unicode decks as you wish// we have the standard 52-card deck and a full deck with 2 jokers (at index 52 and 53)chance; // '🃙'chance; // [ '🃘', '🂦', '🃕', '🃓', '🂷' ]chance_deckfull_deck52 === '🃏';chance_deckfull_deck53 === '🃟';