availableOpeningsfunction
The openings these settings may use: what the variant offers, less the colour-swapping ones when a handicap is bound to a colour — and only the free opening under a head start. Pro and the renju protocols count stones from the first, and a head start's free turns and starting pieces are exactly what that count does not expect.
Import it
import { availableOpenings } from "@johnmorrisdotca/narabe";
Definition
function availableOpenings(settings: GameSettings): OpeningRule[]
Parameters
| Name | Type | Description |
|---|---|---|
settings | GameSettings | The native game settings to interpret. |
Returns
OpeningRule[]
The opening identifiers allowed by the variant, handicap and head-start terms.
Examples
import { availableOpenings, createGame } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
console.log(availableOpenings(state.settings));[ 'free', 'pro', 'longPro', 'swap', 'swap2' ]What it prints (run when this page was built)