encodeOrthogonalGame関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Encodes an orthogonal game with an explicit variant marker and version 2.
インポート
import { encodeOrthogonalGame } from "@johnmorrisdotca/jirai/orthogonal";
ほかのエクスポート元: @johnmorrisdotca/jirai
定義
function encodeOrthogonalGame(game: Game): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
game | Game | The native game, or answer-free VisibleGame required by the signature. |
戻り値
string
Encodes an orthogonal game with an explicit variant marker and version 2.
例
import type { OrthogonalSettings } from "@johnmorrisdotca/jirai/orthogonal";
import { play } from "@johnmorrisdotca/jirai";
import { encodeOrthogonalGame, newOrthogonalGame } from "@johnmorrisdotca/jirai/orthogonal";
const orthogonalSettings: OrthogonalSettings={width:3,height:3,mines:1,noGuess:false,opening:"clear",seed:42};
const orthogonalGame=play(newOrthogonalGame(orthogonalSettings),{kind:"reveal",cell:0});
console.log(encodeOrthogonalGame(orthogonalGame));{"version":2,"variant":"orthogonal","settings":{"width":3,"height":3,"mines":1,"noGuess":false,"opening":"clear","seed":42,"grid":"orthogonal"},"moves":[{"kind":"reveal","cell":0}],"helped":false}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。