decodeOhHellfunction
Text read back into the game of Oh Hell it records, by playing every move again through the rules; null for anything they cannot play out.
Import it
import { decodeOhHell } from "@johnmorrisdotca/toranpu/oh-hell";
Definition
function decodeOhHell(text: string | null): OhHellGame | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | null | The notation, encoded state or saved text to read. |
Returns
OhHellGame | null
Text read back into the game of Oh Hell it records, by playing every move again through the rules; null for anything they cannot play out.
Examples
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { decodeOhHell, encodeOhHell } from "@johnmorrisdotca/toranpu/oh-hell";
const names = Array.from({ length: CARD_GAME_TABLES.ohHell.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
let game = newGame("ohHell", { players: names, seed: 42 })!;
console.log(decodeOhHell(encodeOhHell(game))?.phase);biddingWhat it prints (run when this page was built)