Skip to the content

Narabe並べ

Play forty-eight abstract board games through immutable moves, legal choices and replayable records.

Narabe means arranging in Japanese, as in gomoku-narabe: five in a row. About the name

Contents

Reference · Rules and records

rulesForfunction

The rules a colour plays under: the variant's spec for that colour, with the handicap laid over it when the handicap belongs to that colour.

A handicap can only make a colour's game harder. It adds forbidden shapes, tightens the line rule, lengthens the line, cuts the stones per turn and removes captures; it never loosens anything the variant already imposes.

Import it

import { rulesFor } from "@johnmorrisdotca/narabe";

Definition

function rulesFor(settings: GameSettings, stone: Stone): ColourRules

Parameters

NameTypeDescription
settingsGameSettings

The native game settings to interpret.

stoneStone

The black or white colour being examined.

Returns

ColourRules

The rules a colour plays under: the variant's spec for that colour, with the handicap laid over it when the handicap belongs to that colour. A handicap can only make a colour's game harder. It adds forbidden shapes, tightens the line rule, lengthens the line, cuts the stones per turn and removes captures; it never loosens anything the variant already imposes.

Examples

import { createGame, rulesFor } from "@johnmorrisdotca/narabe";

const state = createGame({variant:"freestyle",size:15});
console.log(rulesFor(state.settings,"black"));
{
  lineRule: 'atLeast',
  forbidden: [],
  captures: false,
  stonesPerTurn: 1,
  winLength: 5,
  secondStoneExclusion: 0
}

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/narabe 1.3.0.