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

pointOffunction

Convert a row-major array index into board coordinates.

Import it

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

Definition

function pointOf(size: number, index: number): Point

Parameters

NameTypeDescription
sizenumber

The number of cells on each side of the board.

indexnumber

The row-major board array index.

Returns

Point

Convert a row-major array index into board coordinates.

Examples

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

console.log(pointOf(15, 112));
{ 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.