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 · Board element

parseEmbedMovesfunction

Reads a bounded JSON move list for a board embed, or null for malformed input.

Import it

import { parseEmbedMoves } from "@johnmorrisdotca/narabe/element";

Also exported from: @johnmorrisdotca/narabe/element/define

Definition

function parseEmbedMoves(value: string | null): MoveInput[] | null

Parameters

NameTypeDescription
valuestring | null

JSON moves, or null for an empty record.

Returns

MoveInput[] | null

Valid move data, or null when the syntax, bounds or shape are invalid. Legality belongs to replayMoves.

Examples

import { parseEmbedMoves } from "@johnmorrisdotca/narabe/element";
console.log(parseEmbedMoves('[{"row":7,"col":7}]'));
[ { row: 7, col: 7 } ]

What it prints (run when this page was built)

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