cardshoe

1.0.8 • Public • Published

CardShoe

CardShoe is a node library written for casino game developers, who want to develop a card based game and are looking for a card shoe that will provide them with access to deal & shuffle the cards.

Git Repository

https://github.com/chetansu/cardshoe

Installation

CardShoe requires Node.js v4+ to run.

$ npm install -g cardshoe

Development

var card_shoe = require('cardshoe');

Once imported the library will create a 1 deck card shoe with 52 cards by default. for having more than 1 deck of cards

card_shoe.setDecks(2);  // CREATES 2 SETS OF CARDS
card_shoe.setDecks(3);  // CREATES 3 SETS OF CARDS
card_shoe.setDecks(n);  // CREATES n SETS OF CARDS

to pull cards use the following

card_shoe.draw(1)       // FOR DEALING 1 CARD - RETURNS ARRAY OF LENGTH 1
card_shoe.draw(2)       // FOR DEALING 2 CARDS - RETURNS ARRAY OF LENGTH 2
card_shoe.draw(n)       // FOR DEALING n CARDS - RETURNS ARRAY OF LENGTH n

to get the history of all cards dealt

card_shoe.getDealtCards()       // RETURNS ALL THE DEALT CARD INFO AS AN ARRAY

After the end of each game call the shuffle to reset the card_shoe with the predefined set of decks

card_shoe.shuffle();

Todos

  • Write Tests

License

ISC

Free Software, Hell Yeah!

Package Sidebar

Install

npm i cardshoe

Weekly Downloads

10

Version

1.0.8

License

ISC

Unpacked Size

4.71 kB

Total Files

4

Last publish

Collaborators

  • chetansuri