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 · Rules and records

DEFAULT_SETTINGSconstant

The defaults used when creating a game without overrides.

Import it

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

Definition

const DEFAULT_SETTINGS: GameSettings = {
    size: DEFAULT_BOARD_SIZE,
    winLength: WIN_LENGTH,
    variant: RULE_VARIANTS.freestyle,
    opening: OPENING_RULES.free,
    handicap: NO_HANDICAP,
    headStart: NO_HEAD_START,
    seed: 0,
    capturesToWin: DEFAULT_CAPTURES_TO_WIN,
    firstPlayer: FIRST_PLAYERS.black,
    obstacles: OBSTACLE_LAYOUTS.none,
    allowUndo: true,
    allowSkip: false,
    allowSwap: false,
    allowResize: false,
    swapsPerSeat: DEFAULT_SWAPS_PER_SEAT,
    drawLimit: DRAW_LIMITS.none,
}

Members

NameTypeDescription
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 (optional)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.

Examples

import { DEFAULT_SETTINGS } from "@johnmorrisdotca/narabe";
console.log(DEFAULT_SETTINGS);
{
  size: 15,
  winLength: 5,
  variant: 'freestyle',
  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'
}

What it prints (run when this page was built)

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