RuleVarianttype
The named rule sets. Each is described as data in VARIANT_SPECS, so the
engine reads a spec rather than switching on the name.
freestyle: five or more in a row wins.
standard: exactly five wins; an overline (six or more) does not.
renju: black is forbidden the double three, double four and overline.
omok: the double three is forbidden for both sides; overlines win.
caro: exactly five wins, and not when blocked at both ends.
ninuki: five in a row wins, and so does capturing five pairs.
connect6: two stones a turn, six in a row wins.
Import it
import type { RuleVariant } from "@johnmorrisdotca/narabe";
Definition
type RuleVariant = "freestyle" | "standard" | "renju" | "omok" | "caro" | "ninuki" | "connect6" | "tictactoe" | "trapThree" | "dropFour" | "twistFive" | "twistFour" | "squareFour" | "ringDrop" | "holeDrop" | "hotDrop" | "clearDrop" | "giveawayDrop" | "edgeDrop" | "dominoFive" | "blockFive" | "sannuki" | "wormDrop" | "misereFive" | "makerBreaker" | "wildTicTacToe" | "notakto" | "toroidalFive" | "reversi" | "classicReversi" | "antiReversi" | "miniReversi" | "grandReversi" | "honeycomb" | "halma" | "hex" | "hexFive" | "obstacleFive" | "rockfall" | "scatteredRocks" | "checkers" | "internationalDraughts" | "brazilianDraughts" | "canadianCheckers" | "russianDraughts" | "poolCheckers" | "chineseCheckers" | "go";
Examples
import type { RuleVariant } from "@johnmorrisdotca/narabe";
const value: RuleVariant = "reversi";
console.log(value);reversiWhat it prints (run when this page was built)