piecesHomefunction
How many of stone's pieces stand in the far camp.
Import it
import { piecesHome } from "@johnmorrisdotca/narabe";
Definition
function piecesHome(board: Cell[], size: number, stone: Stone): number
Parameters
| Name | Type | Description |
|---|---|---|
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. |
Returns
number
How many of stone's pieces stand in the far camp.
Examples
import { createGame, piecesHome } from "@johnmorrisdotca/narabe";
const halma = createGame({variant:"halma",size:8});
console.log(piecesHome(halma.board,8,"black"));0What it prints (run when this page was built)