2.5.7 • Published 2 years ago

preferans-deck-js v2.5.7

Weekly downloads
76
License
Unlicense
Repository
github
Last release
2 years ago

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

2.5.6

2 years ago

2.5.7

2 years ago

2.5.5

3 years ago

2.5.4

3 years ago

2.5.3

3 years ago

2.5.2

4 years ago

2.5.1

4 years ago

2.5.0

4 years ago

2.4.2

4 years ago

2.4.1

4 years ago

2.4.0

4 years ago

2.3.4

4 years ago

2.3.3

4 years ago

2.3.2

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.9

4 years ago

2.2.8

4 years ago

2.2.7

4 years ago

2.2.6

5 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

1.2.1

5 years ago

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago