preferans-deck-js
TypeScript icon, indicating that this package has built-in type declarations

2.5.7 • Public • Published
prefko

preferans-deck-js

build status codacy coverage dependencies npm Greenkeeper badge

Gitpod ready-to-code

preferans deck of cards

Install

yarn add preferans-deck-js

Documentation

TypeDoc documentation

Usage

const preferansDeckJs = require("preferans-deck-js");
const Deck = preferansDeckJs.default;
const Card = preferansDeckJs.Card;

let card = new Card('7');
console.log(card.unicode);
// K♠

let deck = new Deck();
let deal = deck.deal;
console.log("Hand 1:", deal.hand1.unicode);
console.log("Hand 2:", deal.hand2.unicode);
console.log("Hand 3:", deal.hand3.unicode);
console.log("Talon:", deal.talon.talon1.unicode + deal.talon.talon2.unicode);

// Hand 1: 7♠8♠9♠X♠J♠8♥9♥X♥J♥Q♥
// Hand 2: Q♠K♠A♠7♦8♦K♥A♥7♣8♣9♣
// Hand 3: 9♦X♦J♦Q♦K♦X♣J♣Q♣K♣A♣
// Talon: A♦7♥

Labels and meaning

Mostly from Wikipedia.

  • card - duh
  • deck - deck of 32 cards, from 7 to A in all 4 suits
  • hand - cards in one players hands
  • extra - two extra cards left over while dealing
  • reject - two cards the main player rejected
  • round - 3 hands and the extra 2 cards
  • trump - the trump suit per round
  • plain suit - any suit that is not a trump suit
  • trick - cards thrown
  • shuffle - rearrange (a deck of cards)
  • seat - position relative to the dealer
  • ppn - Portable Preferans Notation (patent pending)

API

Wiki API

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.5.71latest

Version History

VersionDownloads (Last 7 Days)Published
2.5.71
2.5.60
2.5.50
2.5.40
2.5.30
2.5.20
2.5.10
2.5.00
2.4.20
2.4.10
2.4.00
2.3.40
2.3.30
2.3.20
2.3.10
2.3.00
2.2.90
2.2.80
2.2.70
2.2.60
2.2.50
2.2.40
2.2.30
2.2.20
2.2.10
2.2.00
2.1.10
2.1.00
2.0.10
1.2.10
1.2.00
1.1.30
1.1.20
1.1.10
1.1.00
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00
0.0.20
0.0.10

Package Sidebar

Install

npm i preferans-deck-js

Weekly Downloads

1

Version

2.5.7

License

Unlicense

Unpacked Size

87.1 kB

Total Files

165

Last publish

Collaborators

  • stojadinovicp
  • dzoni77