Reference · Pipes, rules and solving
gameCodefunction
The game as a code, every piece facing as it does now: what to keep to come back to it, and what to send to be checked.
Import it
import { gameCode } from "@johnmorrisdotca/suido";
Definition
function gameCode(game: Game): string
Parameters
| Name | Type | Description |
|---|---|---|
game | Game | The current immutable game state. |
Returns
string
The game as a code, every piece facing as it does now: what to keep to come back to it, and what to send to be checked.
Examples
import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { gameCode, newGame } from "@johnmorrisdotca/suido";
const row = SUIDO_5X5[0];
const code = row[0];
const game = newGame(code)!;
console.log(gameCode(game));5x5:j5a5C5I59Ib75f7a6CCa35aICWhat it prints (run when this page was built)