FH Cards
A standard 52-card deck library.
Install
npm install fh-cards
Features
- Uses the Fisher-Yates shuffle algorithm
- Optional Joker cards
Example
This example is in TypeScript. It creates a standard deck, shuffles it, draws 2 cards, and then shows those two cards as strings.
; ;deck.shuffle; ;hand.toString; // "8d"hand.toString; // "Ac"
This example is in JavaScript. It does the same thing as the previous example.
let fhc = ;let StandardDeck = fhcStandardDeck; let deck = ;deck; let hand = deck;hand0; // "Ts"hand1; // "5h"