decodeStackUpfunction
Text read back into the game of Stack Up it records, by playing every move again through the rules; null for anything they cannot play out.
Import it
import { decodeStackUp } from "@johnmorrisdotca/toranpu/stack-up";
Definition
function decodeStackUp(text: string | null): StackUpGame | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | null | The notation, encoded state or saved text to read. |
Returns
StackUpGame | null
The game, or null.
Examples
import { decodeStackUp, encodeStackUp, startStackUp } from "@johnmorrisdotca/toranpu/stack-up";
console.log(decodeStackUp(encodeStackUp(startStackUp(15, ["Aki", "Ben"], undefined, 42)!))?.phase);playingWhat it prints (run when this page was built)