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

gunjinCombatfunction

Resolves a club-rules Gunjin Shogi battle without mutating match state. A piece that attacks a flag takes it, and wins; a flag that attacks anything else is removed with it.

Import it

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

Definition

function gunjinCombat(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 club-rules Gunjin Shogi battle without mutating match state. A piece that attacks a flag takes it, and wins; a flag that attacks anything else is removed with it.

Examples

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

console.log(gunjinCombat("engineer","mine"));
attacker

What it prints (run when this page was built)

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