本文へ移動

Narabe並べ

48種類の盤上ゲームを、新しい局面を返す手の操作、合法手の一覧、再生できる棋譜で扱えます。

「並べ」は五目並べの「並べ」。石を並べることを表す言葉です。 名前について(英語)

目次

リファレンス · SVGの盤面

DrawBoardOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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

インポート

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

定義

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

メンバー

名前型説明
width (省略可)number | undefined

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

title (省略可)string | undefined

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

lastMove (省略可)boolean | undefined

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

winningLine (省略可)boolean | undefined

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

forbidden (省略可)boolean | undefined

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

legal (省略可)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 (省略可)Point | undefined

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

例

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 }

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/narabe 1.3.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。