本文へ移動

Narabe並べ

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

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

目次

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

GameSettings型

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

Native rule, layout, opening, handicap and optional action settings.

インポート

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

定義

type GameSettings = {
    size: number;
    winLength: number;
    variant: RuleVariant;
    opening: OpeningRule;
    handicap: Handicap;
    headStart: HeadStart;
    seed: number;
    capturesToWin: number;
    firstPlayer: FirstPlayer;
    obstacles: ObstacleLayout;
    openingDiscs?: StartingDiscs;
    allowUndo: boolean;
    allowSkip: boolean;
    allowSwap: boolean;
    swapsPerSeat: number;
    allowResize: boolean;
    drawLimit: DrawLimit;
};

メンバー

名前型説明
sizenumber

Board is size × size intersections.

winLengthnumber

Stones in a line needed to win.

variantRuleVariant
openingOpeningRule
handicapHandicap
headStartHeadStart

A start for one colour, see HeadStart. NO_HEAD_START for an even game.

seednumber

The random seed the game was created with: it places dead and hot squares and draws the piece queues, so a stored game reproduces them.

capturesToWinnumber

Pairs a colour must capture to win, in the variants that capture.

firstPlayerFirstPlayer
obstaclesObstacleLayout
openingDiscs (省略可)StartingDiscs | undefined

In the flipping games, whether the centre four discs start placed or are laid by the players. Absent, the game's own rule applies.

allowUndoboolean

Taking a move back. Off by default in the stricter variants.

allowSkipboolean

Burning a turn on a corner stone rather than playing where it matters.

allowSwapboolean

Trading seats with the opponent. swapsPerSeat caps how often.

swapsPerSeatnumber
allowResizeboolean

Letting the board change size mid-game, re-centring the stones: up when a game has run out of room, down when it is dragging and the outer ring is unused. Both directions need the other player to agree.

drawLimitDrawLimit

Calling a long game a draw. none plays it out, which is how every game here behaved before this existed and is still the default.

例

import type { GameSettings } from "@johnmorrisdotca/narabe";
import { createGame } from "@johnmorrisdotca/narabe";

const value: GameSettings = createGame({variant:"go",size:9}).settings;
console.log(value);
{
  size: 9,
  winLength: 5,
  variant: 'go',
  opening: 'free',
  handicap: {
    stone: null,
    doubleThree: false,
    doubleFour: false,
    overline: false,
    exactLine: false,
    openLine: false,
    longerLine: false,
    singleStone: false,
    noCaptures: false,
    secondStoneExclusion: 0
  },
  headStart: { stone: null, freeTurns: 0, traditional: 0 },
  seed: 0,
  capturesToWin: 10,
  firstPlayer: 'black',
  obstacles: 'none',
  allowUndo: true,
  allowSkip: false,
  allowSwap: false,
  allowResize: false,
  swapsPerSeat: 1,
  drawLimit: 'none'
}

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

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

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