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 · SVG boards

DrawBoardOptionstype

What to draw besides the board and the stones. Every field is optional.

Import it

import type { DrawBoardOptions } from "@johnmorrisdotca/narabe/draw";

Definition

type DrawBoardOptions = {
    width?: number;
    title?: string;
    lastMove?: boolean;
    winningLine?: boolean;
    forbidden?: boolean;
    legal?: boolean;
    selected?: Point;
};

Members

NameTypeDescription
width (optional)number | undefined

The width in pixels. Unless said, the SVG has a viewBox and no size, and fills what holds it.

title (optional)string | undefined

What a screen reader says for the picture. Unless said, "Board". An empty string makes it decoration.

lastMove (optional)boolean | undefined

Mark the last move with a dot. Unless said, on.

winningLine (optional)boolean | undefined

Ring the stones of a winning line. Unless said, on.

forbidden (optional)boolean | undefined

Cross the points a forbidden-move rule (renju, omok) refuses. Unless said, off.

legal (optional)boolean | undefined

Dot every point the player to move may play, or the squares the piece on from may go to. Unless said, off.

selected (optional)Point | undefined

A piece picked up: its moves are dotted when legal is on, and it is ringed.

Examples

import type { DrawBoardOptions } from "@johnmorrisdotca/narabe/draw";

const value: DrawBoardOptions = {width:480,title:"Opening position",legal:true};
console.log(value);
{ width: 480, title: 'Opening position', legal: true }

What it prints (run when this page was built)

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