decodeGame関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Reads a save by playing it again from the start, so a save cannot claim what its moves do not do. Throws on anything else.
インポート
import { decodeGame } from "@johnmorrisdotca/houseki/tsumiki";
定義
function decodeGame(text: string): GameState
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | A save from encodeGame. |
戻り値
GameState
The state its moves arrive at. Throws for anything that is not such a save.
例
import { createGame, decodeGame, encodeGame } from "@johnmorrisdotca/houseki/tsumiki";
console.log(decodeGame(encodeGame(createGame({ seed: "demo" }))).moves);0出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。