1.0.3 • Published 1 year ago

card-draw v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

NPM Version NPM License NPM Downloads NPM Total Downloads

cardDraw

NPM Package to randomly draw a card from a full deck.

Installation

npm install card-draw

Usage

import cardDraw from 'card-draw'; // if you don't want the drawn card to be replaced in the deck
import cardDrawReplacement from 'card-draw' // if you want the card to be replaced in the deck

console.log(cardDraw()) // returns a randomly selected card as an object and removes it from the deck
console.log(cardDraw().suit) //returns the suit of the randomly drawn card and removes it from the deck

console.log(cardDrawReplacement()) // returns a randomly selected card as an object and keeps it back in the deck
console.log(cardDraw().suit) //returns the suit of the randomly drawn card and keeps it back in the deck

Notes

Adjust the 'value' property of the cards in accordance with the relevant game rules.

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago