Skip to main content
Formal Specification

General's Game / Japanese Chess — Formal Specification

Japan · board-abstract · Confidence: low

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 3
# Shogi — AI-optimized specification ## General idea A two-player deterministic abstract strategy board game played on a 9x9 grid. Distinct from Western chess, captured pieces enter the captor's reserve hand and may be dropped back onto any vacant square on the board, ensuring continuous piece recirculation, dynamic tactical attacks, and no piece attrition until checkmate (*tsumi*). ## Formal model - **Abstraction taken:** None required; traditional Japanese Shogi rules form a completely formalized, deterministic, perfect-information game system. - **Player/agent count:** 2 players (Sente / First Player and Gote / Second Player). - **Turn model:** Strictly sequential alternating turns. Passing is prohibited. ## Formal rules R1. Setup: A 9x9 uncheckered board (81 squares). Each player begins with 20 pieces: 1 King (*Gyoku/Ō*), 1 Rook (*Hisha*), 1 Bishop (*Kaku*), 2 Gold Generals (*Kin*), 2 Silver Generals (*Gin*), 2 Knights (*Keima*), 2 Lances (*Kyōsha*), and 9 Pawns (*Fuhyō*). Sente moves first. R2. On their turn, the active player must make exactly one legal action: either a `board_move` or a `drop_piece`. R3. Movement definitions: - King: 1 step in any of the 8 orthogonal or diagonal directions. - Rook: Any distance orthogonally; Promoted Rook (*Dragon / Ryūō*) adds 1 step diagonally. - Bishop: Any distance diagonally; Promoted Bishop (*Horse / Ryūma*) adds 1 step orthogonally. - Gold General: 1 step orthogonally in 4 directions or 1 step diagonally forward (6 directions total). - Silver General: 1 step diagonally in 4 directions or 1 step orthogonally forward (5 directions total). - Knight: Jumps 2 squares forward and 1 square left or right (2 destinations); jumps over intervening pieces. - Lance: Any distance directly forward. - Pawn: 1 step directly forward. R4. Capture and Drops (*Mochigoma*): - Moving onto an enemy-occupied square captures that piece, removing it to the captor's reserve stand (*komadai*) in its unpromoted state. - On any turn, a player may drop an unpromoted reserve piece onto any vacant square. R5. Promotion (*Nari*): - The promotion zone consists of the opponent's three home ranks (ranks 1–3 for Sente, ranks 7–9 for Gote). - When a piece enters, moves within, or exits the promotion zone, it may promote. - Promoted Silver, Knight, Lance, and Pawn move identically to a Gold General. - Promotion is mandatory if the piece would otherwise have no legal forward moves. R6. Illegal Moves (*Hansoku* — causes immediate forfeit): - *Nifu* (Double Pawn): Dropping a Pawn onto a file already containing an unpromoted friendly Pawn. - *Uchifuzume* (Pawn Drop Mate): Dropping a Pawn that delivers immediate inescapable checkmate. - Dropping a piece onto a square with no legal moves (e.g. Pawn/Lance on the 1st rank). - Leaving one's King in check or moving into check. - *Renzoku Oute no Sennichite*: Perpetual check causing 4-fold repetition (the checking player forfeits). R7. Win conditions: Delivering checkmate (*tsumi*) or forcing opponent resignation (*tōryō*). R8. [gap-fill] Impasse (*Jishōgi*) resolution: If both Kings advance into their promotion zones and cannot be mated, the game is decided by the 27-Point Rule: Rooks and Bishops count as 5 points each, other pieces (except King) count as 1 point. If both players hold at least 24 points, the game is declared a draw; otherwise, the player with >= 28 points wins. R9. [gap-fill] Repetition draw (*Sennichite*): If the identical board and reserve position occurs 4 times without continuous check, the game ends immediately in a draw. R10. [gap-fill] Maximum move hard cap: If 500 total plies (250 turns per player) elapse without a checkmate or impasse declaration, the game terminates automatically as a draw. ## Edge cases - **Tie at the end condition:** Possible via non-check Sennichite (R9) or Jishōgi impasse draw (R8). - **A player with no legal move:** If a player has no legal moves and their King is in check, they are checkmated; if not in check, it is stalemate (scored as a loss for the immobilized player under standard Shogi rules). - **Repetition / cycles:** Four-fold repetition is prohibited during check (forfeit) or results in a draw (R9); bounded by R10 (500-ply limit). - **Simultaneous claims on the same resource or position:** Not applicable; turns are strictly sequential. - **Player elimination mid-round:** Not applicable; strictly a 2-player duel. - **Resource exhaustion:** Captured pieces recirculate onto the board; pieces are never permanently eliminated. - **Termination guarantee:** Guaranteed by finite move-tree depth under the 500-ply hard limit (R10) and four-fold repetition draw rule (R9). ## State representation - **Persistent state:** `board` (9x9 array of pieces with owner and promotion flag), `in_hand[2]` (counts of captured piece types per player), `active_player` (SENTE or GOTE), `ply_count` (int in `[0..500]`), `position_history` (hash map of board+hand configurations to frequency). - **Observable information:** Fully observable perfect-information game. ## Action space - `move_piece(from_sq: (x,y), to_sq: (x,y), promote: bool)`: Move board piece with optional/mandatory promotion. - `drop_piece(piece_type: enum, to_sq: (x,y))`: Deploy captured piece from hand to vacant square. - `resign()`: Concede match. ## Playability notes - **Single-player-vs-AI:** World-class engine domain (Apery, elmo, YaneuraOu, AlphaZero); alpha-beta search with NNUE evaluation or MCTS with policy-value neural networks. - **Group games (n>4):** Strictly a 2-player game; can be played in relay teams (*Rengo Shogi*). - **Physical-skill games:** Not applicable (pure discrete abstract strategy). - **What is lost in the adaptation:** The physical snapping sound (*pachi!*) of wooden wedge pieces on a solid kaya shogiban. ## Implementation hints Discrete 9x9 coordinate space (81 squares). Use 64-bit/128-bit bitboards or piece-centric mailbox representations. Branching factor is high (~80–120 legal moves per turn due to drops). First milestone: implement legal board moves, piece captures, drops, promotion, and *Nifu* validation filters.

Download as JSON

Download the full game corpus entry for this game as structured JSON.

Download JSON
Cite this page

Shogi (Japan). (n.d.). Games of Countries. https://gamesofcountries.com/games/jp-japan/shogi

@misc{gamesofcountries-jp-japan-shogi,
  title = {Shogi (Japan)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/jp-japan/shogi}
}