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

CheckersRulestype

How one game of the checkers family is played, as data: the rows of men each side sets out, which way a man may take, how far a king may travel, which capture must be chosen, and what crowning does to a capture under way.

Every one of these is a rule some published game differs on, and the engine reads them here rather than asking which game it is playing.

Import it

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

Definition

type CheckersRules = {
    menRows: number;
    menCaptureBackward: boolean;
    flyingKings: boolean;
    captureChoice: CaptureChoice;
    crownMidCapture: CrownMidCapture;
    repetitionDraw: number | null;
    endgameCounts: readonly EndgameCount[];
};

Members

NameTypeDescription
menRowsnumber

Rows of men each side starts with, on the dark squares of its own side of the board.

menCaptureBackwardboolean

Whether a man may capture backward as well as forward. It always steps forward only.

flyingKingsboolean

Whether a king flies: moves any distance along an open diagonal, and takes a piece at any distance, landing on any empty square beyond it. Otherwise a king moves one square and jumps an adjacent piece, as a man does, both ways.

captureChoiceCaptureChoice
crownMidCaptureCrownMidCapture
repetitionDrawnumber | null

The same position standing for this many times, with the same side to move, is a draw. Null where this game is not played with a repetition rule here.

endgameCountsreadonly EndgameCount[]

The endings the stronger side must win within a count of moves, or draw.

Examples

import type { CheckersRules } from "@johnmorrisdotca/narabe";
import { ENGLISH_CHECKERS_RULES } from "@johnmorrisdotca/narabe";

const value: CheckersRules = ENGLISH_CHECKERS_RULES;
console.log(value);
{
  menRows: 3,
  menCaptureBackward: false,
  flyingKings: false,
  captureChoice: 'free',
  crownMidCapture: 'stops',
  repetitionDraw: null,
  endgameCounts: []
}

What it prints (run when this page was built)

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