chooseColourfunction
The deciding seat takes stone. Seats are exchanged if that colour is not
already theirs; the board and the colour to move are untouched.
Import it
import { chooseColour } from "@johnmorrisdotca/narabe";
Definition
function chooseColour(state: GameState, stone: Stone): GameState
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
stone | Stone | The black or white colour being examined. |
Returns
GameState
The resulting position; a refused or inapplicable action leaves the input position unchanged.
Examples
import { chooseColour, createGame } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
console.log(chooseColour(state,"black").opening.stage);doneWhat it prints (run when this page was built)