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

canBeDrawnfunction

Whether this game can be drawn at all.

Hex cannot. A full Hex board always holds exactly one chain from side to side, so there is no position in which neither player has won — and the rules page says so as a fact about the shape of the board rather than as a rule anybody wrote. A length that could produce a drawn Hex game would make that sentence false, so the length simply does not apply there, and the setting is refused rather than quietly ignored.

Read from the spec, never from a variant's name: any game that is won by joining two sides has the same theorem behind it.

Import it

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

Definition

function canBeDrawn(settings: GameSettings): boolean

Parameters

NameTypeDescription
settingsGameSettings

The native game settings to interpret.

Returns

boolean

Whether the native game mechanics can end in a draw.

Examples

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

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

What it prints (run when this page was built)

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