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 · Hidden capture-flag rules

strategoCombatfunction

Resolves a Capture Flag battle without mutating either piece or match.

Import it

import { strategoCombat } from "@johnmorrisdotca/gunjin/stratego-lite";

Definition

function strategoCombat(attacker: string, defender: string): "attacker" | "defender" | "both"

Parameters

NameTypeDescription
attackerstring

The native role key of the attacking piece.

defenderstring

The native role key of the defending piece.

Returns

"attacker" | "defender" | "both"

Resolves a Capture Flag battle without mutating either piece or match.

Examples

import { strategoCombat } from "@johnmorrisdotca/gunjin/stratego-lite";

console.log(strategoCombat("miner","bomb"));
attacker

What it prints (run when this page was built)

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