pegPointsfunction
What laying the last card of cards scores, the count now count: fifteen, thirty-one, pairs and runs.
Import it
import { pegPoints } from "@johnmorrisdotca/toranpu/cribbage";
Definition
function pegPoints(cards: readonly CardId[], count: number): { points: number; why: string[]; }
Parameters
| Name | Type | Description |
|---|---|---|
cards | readonly string[] | The cards in their current order. |
count | number | The requested number of cards, sounds or layout positions. |
Returns
{ points: number; why: string[]; }
What laying the last card of cards scores, the count now count: fifteen, thirty-one, pairs and runs.
Examples
import { pegPoints } from "@johnmorrisdotca/toranpu/cribbage";
console.log(pegPoints(["5H", "5D", "5C"], 15));{ points: 8, why: [ 'fifteen', 'three alike' ] }What it prints (run when this page was built)