piecesHome関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How many of stone's pieces stand in the far camp.
インポート
import { piecesHome } from "@johnmorrisdotca/narabe";
定義
function piecesHome(board: Cell[], size: number, stone: Stone): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
board | Cell[] | The row-major board cells; null marks an empty point. |
size | number | The number of cells on each side of the board. |
stone | Stone | The black or white colour being examined. |
戻り値
number
How many of stone's pieces stand in the far camp.
例
import { createGame, piecesHome } from "@johnmorrisdotca/narabe";
const halma = createGame({variant:"halma",size:8});
console.log(piecesHome(halma.board,8,"black"));0出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。