ColourRulestype
The rules one colour actually plays under: the variant's spec for that colour with the handicap laid over it. Everything in the engine that asks "may this colour…" reads one of these, never the spec directly.
Import it
import type { ColourRules } from "@johnmorrisdotca/narabe";
Definition
type ColourRules = {
lineRule: LineRule;
forbidden: readonly ForbiddenPattern[];
captures: boolean;
stonesPerTurn: number;
winLength: number;
secondStoneExclusion: number;
};
Members
| Name | Type | Description |
|---|---|---|
lineRule | LineRule | |
forbidden | readonly ForbiddenPattern[] | |
captures | boolean | |
stonesPerTurn | number | |
winLength | number | |
secondStoneExclusion | number |
Examples
import { createGame, rulesFor } from "@johnmorrisdotca/narabe";
import type { ColourRules } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
const value: ColourRules = rulesFor(state.settings,"black");
console.log(value);{
lineRule: 'atLeast',
forbidden: [],
captures: false,
stonesPerTurn: 1,
winLength: 5,
secondStoneExclusion: 0
}What it prints (run when this page was built)