Skip to the content

Gunjin軍人

Play five hidden-rank games, keep setups private, share redacted views and replay, and pass one device between players.

Gunjin is the Japanese word 軍人 for a soldier. About the name

Contents

Reference · Gunjin Shogi club rules

GUNJIN_SHOGI_RULESconstant

The documented 31-piece club ruleset, on a plain 9×9 board.

Import it

import { GUNJIN_SHOGI_RULES } from "@johnmorrisdotca/gunjin/gunjin-shogi";

Definition

const GUNJIN_SHOGI_RULES: ModeRules = {
    mode: "gunjin-shogi",
    defaultWidth: 9,
    defaultHeight: 9,
    acceptsSize: (width, height) => width === 9 && height === 9,
    roster: () => ROSTER,
    validateSetup,
    legalDestinations,
    resolveMove,
}

Members

NameTypeDescription
modeGameMode
defaultWidthnumber
defaultHeightnumber
acceptsSize(width: number, height: number) => boolean
roster(player: Player, width: number, height: number) => readonly string[]
validateSetup(player: Player, placements: readonly SetupPiece[]) => boolean
legalDestinations(match: AuthoritativeMatch, piece: Piece) => readonly Coordinate[]
resolveMove(match: AuthoritativeMatch, piece: Piece, destination: Coordinate) => MoveResolution

Examples

import { GUNJIN_SHOGI_RULES } from "@johnmorrisdotca/gunjin/gunjin-shogi";

console.log(GUNJIN_SHOGI_RULES.mode);
gunjin-shogi

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/gunjin 0.2.1.