Skip to main content
Formal Specification

Seega (Sri Lankan 25-Square Abstract Game) — Formal Specification

Sri Lanka · board-abstract · Confidence: high

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 3
# Seega Keliya — AI-optimized specification ## General idea Seega Keliya is an ancient Sri Lankan two-player abstract strategy board game played on a 5x5 grid (25 squares). Players take turns placing 12 pieces each while keeping the central sanctuary square vacant, followed by a dynamic orthogonal movement phase where pieces sandwich opposing pieces to execute custodial captures and earn consecutive bonus turns. ## Formal model - **Abstraction taken:** Direct discrete formalization on a 5x5 coordinate grid `(r, c)` where `r, c in {0..4}`. Central square `(2, 2)` is designated as the *Meda Kotuwa* (Center Sanctuary). Total of 24 pieces (12 White, 12 Black). - **Player/agent count:** Exactly 2 players (Player 0 / White, Player 1 / Black). - **Turn model:** Two-phase strictly sequential turns (Phase 1: 2-piece placement; Phase 2: movement with conditional multi-capture chain). ## Formal rules R1. Setup & Board Topology: - 5x5 grid of 25 cells. Central sanctuary cell `Center = (2, 2)`. - Board starts completely empty. - Each player holds 12 pieces off-board (`unplaced[0] = 12`, `unplaced[1] = 12`). - Active player starts as Player 0. R2. Phase 1 — Piece Placement (*Itthan Dæmeema*): - On their turn, the active player places exactly 2 pieces onto any two vacant cells on the board, with the strict constraint that `Center = (2, 2)` MUST remain empty. - Phase 1 lasts exactly 6 rounds per player (12 turns total). - At the conclusion of Phase 1, exactly 24 pieces occupy the 24 perimeter/outer squares, leaving only `Center` vacant. R3. Phase 2 — Orthogonal Movement: - Starting with Player 0, the active player selects one friendly piece at `(r1, c1)` and slides it orthogonally into an adjacent vacant cell `(r2, c2)` (where `|r1 - r2| + |c1 - c2| == 1`). - Diagonal movement is strictly forbidden. R4. Custodial Capture (*Käpeema*): - If moving a friendly piece to `(r2, c2)` sandwiches an adjacent enemy piece between `(r2, c2)` and another friendly piece along a straight orthogonal line: - The sandwiched enemy piece is captured and removed from the board. - Multiple captures along intersecting orthogonal axes (e.g. one horizontal and one vertical enemy piece simultaneously trapped) are all removed. - *Safe Entry:* If a player voluntarily moves their own piece into a gap between two enemy pieces, that piece is NOT captured (custodial trap triggers only on the attacker's active move). - *Center Sanctuary Rule:* A piece resting in `Center = (2, 2)` is immune to capture, but may serve as an anchoring friendly piece to trap adjacent enemy pieces outside the sanctuary. R5. Consecutive Capture Rule: - If a move results in a capture, the player earns an immediate bonus move using the *same piece*, provided that piece can make another legal orthogonal move resulting in another capture. This chaining continues until no further captures can be made by that piece. R6. Stalemate / Blockade Resolution: - [gap-fill] If a player has no legal moves because all their remaining pieces are orthogonally blocked by enemy pieces, the opponent must make a move on their turn that creates an opening for the trapped player. R7. Win / Loss & Termination: - A player loses immediately if reduced to 0 pieces (or 1 piece, which is incapable of executing captures). - [gap-fill] Threefold Repetition: If the exact board configuration recurs 3 times with the same player to move, the game is declared a draw. - [gap-fill] 50-Move Rule: If 50 consecutive non-capturing moves occur, the game is declared a draw. ## Edge cases - Tie at the end condition: Declared under threefold repetition or 50-move non-capture rule. - A player with no legal move: Handled by R6 — opponent must provide a passage; if opponent cannot move without giving a capture, game ends. - Repetition / cycles: Bounded strictly by R7 (threefold repetition and 50-move non-capture cap), guaranteeing termination. - Simultaneous claims on the same resource: Not applicable — cells are occupied sequentially. - Player elimination mid-round: Reduction to <= 1 piece triggers immediate game loss. - Resource exhaustion: Captured pieces are permanently removed from the board. - Termination guarantee: Captures strictly reduce total pieces from 24 toward 2, and non-capturing sequences are bounded by 50 moves. ## State representation - Persistent state: - `board` (5x5 2D array: `0 = Player 0`, `1 = Player 1`, `-1 = EMPTY`). - `piece_counts` (2-element array `[count_0, count_1]`). - `active_player` (0 or 1). - `phase` (1 = PLACEMENT, 2 = MOVEMENT). - `halfmove_clock` (integer tracking non-capturing moves). - `position_history` (hash map of position states). - Per-turn ephemeral state: - `chain_piece_pos` (optional `(r, c)` of piece executing consecutive captures). - `placements_remaining_this_turn` (integer `0..2` in Phase 1). - Observable information: Fully observable — complete 5x5 board state and piece counts are public. ## Action space - `place_piece(r, c)`: - Phase 1. Precondition: `board[r][c] == EMPTY` and `(r, c) != (2, 2)`. - `move_piece(r_from, c_from, r_to, c_to)`: - Phase 2. Precondition: `board[r_from][c_from] == active_player`, `board[r_to][c_to] == EMPTY`, and orthogonal adjacency `|r_from - r_to| + |c_from - c_to| == 1`. ## Playability notes - Single-player-vs-AI: Engine-ready perfect-information abstract strategy game. Highly suitable for Minimax with Alpha-Beta pruning, bitboard representation, or MCTS. - Group games (n>4): Strictly a 2-player board game. - Physical-skill games: Purely mathematical discrete board game with zero physical randomness. - What is lost in the adaptation: The tactile sensation of placing white quartz pebbles and dark river stones onto ancient Anuradhapura granite slabs. ## Implementation hints Extremely clean 2D grid representation (5x5 can be stored in a 32-bit bitboard or flat 25-element array). Branching factor is ~24 in placement phase and ~4–12 in movement phase. Milestone 1: implement 2-phase placement, orthogonal adjacency check, custodial sandwich detection, center sanctuary immunity, and Alpha-Beta bot in under 180 lines.

Download as JSON

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

Download JSON
Cite this page

Seega Keliya (Sri Lanka). (n.d.). Games of Countries. https://gamesofcountries.com/games/lk-sri-lanka/seega-keliya

@misc{gamesofcountries-lk-sri-lanka-seega-keliya,
  title = {Seega Keliya (Sri Lanka)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/lk-sri-lanka/seega-keliya}
}