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

movesBeforeDrawfunction

How many moves may be played before a game nobody has won is a draw, or null when it is to be played out.

Rounded down, so "half the board" on an odd board is the smaller half: a limit that arrives a move early is easier to defend than one that arrives a move late.

Import it

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

Definition

function movesBeforeDraw(settings: GameSettings): number | null

Parameters

NameTypeDescription
settingsGameSettings

The native game settings to interpret.

Returns

number | null

The configured move limit, or null when the settings have no applicable length limit.

Examples

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

const state = createGame({variant:"freestyle",size:15});
console.log(movesBeforeDraw(state.settings));
null

What it prints (run when this page was built)

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