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
| Name | Type | Description |
|---|---|---|
attacker | string | The native role key of the attacking piece. |
defender | string | 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"));attackerWhat it prints (run when this page was built)