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 · Redacted player and observer views

boardFeaturesfunction

Public board markings (camps, headquarters and lakes), with no role-dependent information.

Import it

import { boardFeatures } from "@johnmorrisdotca/gunjin/views";

Also exported from: @johnmorrisdotca/gunjin

Definition

function boardFeatures(mode: AuthoritativeMatch["mode"], width: number, height: number): { camps: Coordinate[]; headquarters: Coordinate[]; lakes: Coordinate[]; }

Parameters

NameTypeDescription
modeGameMode

The native rule-mode key.

widthnumber

The native board width in holes.

heightnumber

The native board height in holes.

Returns

{ camps: Coordinate[]; headquarters: Coordinate[]; lakes: Coordinate[]; }

Public board markings (camps, headquarters and lakes), with no role-dependent information.

Examples

import { boardFeatures } from "@johnmorrisdotca/gunjin/views";

console.log(boardFeatures("luzhanqi-mini",7,8));
{
  camps: [ { x: 1, y: 3 }, { x: 5, y: 3 }, { x: 1, y: 4 }, { x: 5, y: 4 } ],
  headquarters: [ { x: 1, y: 0 }, { x: 5, y: 0 }, { x: 1, y: 7 }, { x: 5, y: 7 } ],
  lakes: []
}

What it prints (run when this page was built)

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