decodeTenka関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A kept game read back, or null for nothing kept, or for text that is not a game these rules can play out again: a browser's storage is somebody's to edit, and a half-understood game is worse than none.
インポート
import { decodeTenka } from "@johnmorrisdotca/tenka";
定義
function decodeTenka(text: string | null): TenkaGame | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | null | The encoded game text to validate and replay. |
戻り値
TenkaGame | null
The reconstructed game, or null for absent, malformed, unsupported or illegal saved data.
例
import { decodeTenka, encodeTenka, startTenka } from "@johnmorrisdotca/tenka";
const game = startTenka(10,["Seat 1","Seat 2"],42)!;
console.log(decodeTenka(encodeTenka(game))?.seed);42出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。