deckshoes

0.4.0 • Public • Published

Logo

Deck Shoes

A simple implementation of playing cards, decks and shoes.
Explore the docs »

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. 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

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i deckshoes

    Weekly Downloads

    2

    Version

    0.4.0

    License

    MIT

    Unpacked Size

    61.3 kB

    Total Files

    8

    Last publish

    Collaborators

    • simpleprogramming