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

resignfunction

Gives the game up. The other colour wins at once, with no line to show; the record keeps the moves as they were and says why it ended. A finished game cannot be resigned — there is nothing left to give.

Import it

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

Definition

function resign(state: GameState, loser: Stone): GameState

Parameters

NameTypeDescription
stateGameState

The current immutable game position.

loserStone

The colour that resigned or ran out of time.

Returns

GameState

The resulting position; a refused or inapplicable action leaves the input position unchanged.

Examples

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

const state = createGame({variant:"freestyle",size:15});
console.log(resign(state,"black").winner);
white

What it prints (run when this page was built)

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