gunjinCombat関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { gunjinCombat } from "@johnmorrisdotca/gunjin/gunjin-shogi";
定義
function gunjinCombat(attacker: string, defender: string): "attacker" | "defender" | "both"
引数
| 名前 | 型 | 説明 |
|---|---|---|
attacker | string | The native role key of the attacking piece. |
defender | string | The native role key of the defending piece. |
戻り値
"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.
例
import { gunjinCombat } from "@johnmorrisdotca/gunjin/gunjin-shogi";
console.log(gunjinCombat("engineer","mine"));attacker出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。