本文へ移動

Narabe並べ

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

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

目次

リファレンス · ルールと棋譜

STAR_POINTS定数

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

Hoshi (star point) positions drawn on the board, by board size: the four corner points, plus tengen at the centre, and for 19×19 the side points too.

インポート

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

定義

const STAR_POINTS: Record<number, readonly Point[]> = {
    9: starGrid([2, 4, 6], [2, 6]),
    13: starGrid([3, 6, 9], [3, 9]),
    15: starGrid([3, 7, 11], [3, 11]),
    19: starGrid([3, 9, 15], [3, 9, 15]),
}

例

import { STAR_POINTS } from "@johnmorrisdotca/narabe";
console.log(STAR_POINTS);
{
  '9': [
    { row: 2, col: 2 },
    { row: 2, col: 6 },
    { row: 4, col: 4 },
    { row: 6, col: 2 },
    { row: 6, col: 6 }
  ],
  '13': [
    { row: 3, col: 3 },
    { row: 3, col: 9 },
    { row: 6, col: 6 },
    { row: 9, col: 3 },
    { row: 9, col: 9 }
  ],
  '15': [
    { row: 3, col: 3 },
    { row: 3, col: 11 },
    { row: 7, col: 7 },
    { row: 11, col: 3 },
    { row: 11, col: 11 }
  ],
  '19': [
    { row: 3, col: 3 },
    { row: 3, col: 9 },
    { row: 3, col: 15 },
    { row: 9, col: 3 },
    { row: 9, col: 9 },
    { row: 9, col: 15 },
    { row: 15, col: 3 },
    { row: 15, col: 9 },
    { row: 15, col: 15 }
  ]
}

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

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

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