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

orientationsfunction

Every distinct way the piece can lie: four rotations, each also mirrored. Colours travel with their cells, so a black-white domino turned round is a different orientation from the one it started as.

Import it

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

Definition

function orientations(piece: Piece): PieceCell[][]

Parameters

NameTypeDescription
piecePiece

The queued piece with relative coloured cells.

Returns

PieceCell[][]

Every distinct way the piece can lie: four rotations, each also mirrored. Colours travel with their cells, so a black-white domino turned round is a different orientation from the one it started as.

Examples

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

console.log(orientations({cells:[{row:0,col:0,stone:"black"},{row:0,col:1,stone:"white"}]}).length);
4

What it prints (run when this page was built)

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