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

landingPointsfunction

The one landing cell per column with room: the only cells a drop can fill.

Import it

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

Definition

function landingPoints(board: Cell[], size: number): Point[]

Parameters

NameTypeDescription
boardCell[]

The row-major board cells; null marks an empty point.

sizenumber

The number of cells on each side of the board.

Returns

Point[]

The one landing cell per column with room: the only cells a drop can fill.

Examples

import { createGame, landingPoints } from "@johnmorrisdotca/narabe";

const drop = createGame({variant:"dropFour"});
console.log(landingPoints(drop.board,drop.settings.size));
[
  { row: 6, col: 0 },
  { row: 6, col: 1 },
  { row: 6, col: 2 },
  { row: 6, col: 3 },
  { row: 6, col: 4 },
  { row: 6, col: 5 },
  { row: 6, col: 6 }
]

What it prints (run when this page was built)

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