Deck Shoes
A simple implementation of playing cards, decks and shoes.
Explore the docs »
Table of Contents
About The Project
Deck Shoes is a simple implementation for playing cards suitable for various games. It includes custom deck implementation for games like 500 as well as stripped decks like the Spanish deck and the Piquet deck.
Getting Started
Installation
npm install deckshoes@latest
Usage
Create a Playing Card
import { PlayingCard, Suit } from 'deckshoes';
const cardFromConstructor = new PlayingCard("A", Suit.spades);
//or
const cardFromString = PlayingCard.parseString("AS");
Create a Deck of Cards
import { PlayingCard, Deck } from 'deckshoes';
//Deck creation
const emptyDeck = new Deck();
const standardDeck = Deck.generateStandardDeck();
//Draw a random card from the deck
const card = standardDeck.drawCard();
Create a multi-deck Shoe
import { PlayingCard, Deck, Shoe } from 'deckshoes';
//Start with an empty deck
const emptyShoe = new Shoe();
//or start with a set number of standard 52-card decks
const prefilledShoe = new Shoe(6);
//Draw a random card from the shoe
const card = prefilledShoe.drawCard();
For more examples, please refer to the Documentation
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Simple Programming - @samjanda - hi@simpleprogramming.com.au
Project Link: https://bitbucket.org/simpleprogramming1/playing-cards