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

winOnTimefunction

Ends the game against a player who has run out of time.

A clock is not a rule of gomoku, so the engine does not run one — but the result still has to be a proper game state rather than something the UI paints over the top, or the record and the board would disagree.

Import it

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

Definition

function winOnTime(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, winOnTime } from "@johnmorrisdotca/narabe";

const state = createGame({variant:"freestyle",size:15});
console.log(winOnTime(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.