cribbageViewfunction
The part of the game the seat to play can see, which is all its computer is given.
Import it
import { cribbageView } from "@johnmorrisdotca/toranpu/cribbage";
Definition
function cribbageView(game: CribbageGame): CribbageView
Parameters
| Name | Type | Description |
|---|---|---|
game | CribbageGame | The current native game; applying a move returns a new state. |
Returns
CribbageView
The part of the game the seat to play can see, which is all its computer is given.
Examples
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { cribbageView } from "@johnmorrisdotca/toranpu/cribbage";
const names = Array.from({ length: CARD_GAME_TABLES.cribbage.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
let game = newGame("cribbage", { players: names, seed: 42 })!;
console.log(cribbageView(game));{
seat: 1,
dealer: 0,
phase: 'crib',
hand: [ 'AD', '3S', '5D', '9S', '9H', 'JD' ],
count: 0,
run: []
}What it prints (run when this page was built)