Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 682 Bytes

README.md

File metadata and controls

34 lines (27 loc) · 682 Bytes

Card-Deck

Here is few basic functionality for a card game like shuffle, draw etc

Installation

  npm install card_deck --save

Usage

   const Deck = require('card_deck');
   let deck =  new Deck();

Shuffle

   var newDeck =  deck.shuffle(); // It will return an array of 52 cards (shuffled)

Draw(count)

  var draw = deck.draw(5); // It will return 5 random card from the existing deck.

Add Deck

   var newDeck = deck.add(3); // It will return 52 * 3 shuffled cards.

Left Cards

   var leftOutCards = deck.left(); // Get left out cards after draw