resolvePlacementfunction
Where a stone played at point actually goes: the same point, or in a
drop game the bottom of its column. A click anywhere in a column is a play
in that column.
Import it
import { resolvePlacement } from "@johnmorrisdotca/narabe";
Definition
function resolvePlacement(state: GameState, point: Point): Point
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
point | Point | A zero-based row and column on the board. |
Returns
Point
Where a stone played at point actually goes: the same point, or in a drop game the bottom of its column. A click anywhere in a column is a play in that column.
Examples
import { createGame, resolvePlacement } from "@johnmorrisdotca/narabe";
const drop = createGame({variant:"dropFour"});
console.log(resolvePlacement(drop,{row:0,col:0}));{ row: 6, col: 0 }What it prints (run when this page was built)