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

HEX_LINE_DIRECTIONSconstant

The three line orientations on the hexagon lattice — see rules/hexagon.ts for the embedding. Each is checked both ways, covering the six neighbours a hexagon cell has. Three of the square board's own four: horizontal, vertical and the slanted diagonal that follows the lattice's shear. The fourth, {row: 1, col: 1}, is a diagonal of the SQUARE embedding only — two cells that far apart along it are not lattice neighbours, and no unbroken run of hexagon cells ever lies along it — so it is left out here on purpose, never scanned as a line.

Import it

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

Definition

const HEX_LINE_DIRECTIONS: readonly Point[] = [
    { row: 0, col: 1 },
    { row: 1, col: 0 },
    { row: 1, col: -1 },
]

Examples

import { HEX_LINE_DIRECTIONS } from "@johnmorrisdotca/narabe";
console.log(HEX_LINE_DIRECTIONS);
[ { row: 0, col: 1 }, { row: 1, col: 0 }, { row: 1, col: -1 } ]

What it prints (run when this page was built)

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