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

dropTargetfunction

Where a stone dropped into col lands, or null when the column is full.

Import it

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

Definition

function dropTarget(board: Cell[], size: number, col: number): Point | null

Parameters

NameTypeDescription
boardCell[]

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

sizenumber

The number of cells on each side of the board.

colnumber

The zero-based column.

Returns

Point | null

The landing point, or null when that column has no landing cell.

Examples

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

const drop = createGame({variant:"dropFour"});
console.log(dropTarget(drop.board,drop.settings.size,0));
{ row: 6, col: 0 }

What it prints (run when this page was built)

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