本文へ移動

Narabe並べ

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

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

目次

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

StoredGame型

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

The stored shape of a game, as both the API and the pages see it.

インポート

import type { StoredGame } from "@johnmorrisdotca/narabe";

定義

type StoredGame = {
    size: number;
    winLength: number;
    variant: string;
    obstacles: string;
    opener: string;
    opening?: string;
    handicap?: Handicap | null;
    headStart?: HeadStart | null;
    seed?: number;
    drawLimit?: string;
    moveTimeMs: number | null;
    moves: MoveInput[];
};

メンバー

名前型説明
sizenumber
winLengthnumber
variantstring
obstaclesstring
openerstring
opening (省略可)string | undefined
handicap (省略可)Handicap | null | undefined
headStart (省略可)HeadStart | null | undefined

The head start, parsed — see parseHeadStart. Games stored before head starts had none.

seed (省略可)number | undefined
drawLimit (省略可)string | undefined

See DrawLimit. Games recorded before it existed carry "none", as they were played.

moveTimeMsnumber | null

The clock, or null for none. Required rather than optional: a turn lost to the clock replays only on a record that had one, and a reader that forgot to pass it would cut every such game short at the turn that was lost.

movesMoveInput[]

例

import type { StoredGame } from "@johnmorrisdotca/narabe";

const stored = {size:15,winLength:5,variant:"freestyle",obstacles:"none",opener:"black",moveTimeMs:null,moves:[{row:7,col:7}]};
const value: StoredGame = stored;
console.log(value);
{
  size: 15,
  winLength: 5,
  variant: 'freestyle',
  obstacles: 'none',
  opener: 'black',
  moveTimeMs: null,
  moves: [ { row: 7, col: 7 } ]
}

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

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

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