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

replayGamefunction

The position as it stands now.

Import it

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

Definition

function replayGame(game: StoredGame): GameState

Parameters

NameTypeDescription
gameStoredGame

The saved settings and move record to rebuild.

Returns

GameState

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

Examples

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

const stored = {size:15,winLength:5,variant:"freestyle",obstacles:"none",opener:"black",moveTimeMs:null,moves:[{row:7,col:7}]};
console.log(replayGame(stored).moves.length);
1

What it prints (run when this page was built)

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