twistBoard関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Turns one quadrant to finish the move. The whole board is read afterwards, because a turn can complete a line for either colour anywhere: one line wins for its owner, a line for each is a draw, and a full board with no line is a draw too.
インポート
import { twistBoard } from "@johnmorrisdotca/narabe";
定義
function twistBoard(state: GameState, quadrant: number, clockwise: boolean): GameState
引数
| 名前 | 型 | 説明 |
|---|---|---|
state | GameState | The current immutable game position. |
quadrant | number | The zero-based quadrant index. |
clockwise | boolean | Whether to turn clockwise rather than anticlockwise. |
戻り値
GameState
The resulting position; a refused or inapplicable action leaves the input position unchanged.
例
import { createGame, playMove, twistBoard } from "@johnmorrisdotca/narabe";
console.log(twistBoard(playMove(createGame({variant:"twistFive"}),{row:0,col:0}),0,true).pendingTwist);false出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。