Kepung
A classic Malaysian pen-and-paper schoolyard game. Capture your opponent's dots by surrounding them.
Play nowPlace
On your turn, place a dot on any open intersection.
Form
Your same-coloured dots auto-connect into gates if they sit one step apart.
Capture
Surround at least one of your opponent's dots with your gates to capture it. Empty enclosures don't claim. Highest captures wins.
How to play (full rules)
Two players take turns placing dots on a square grid. Same-colour dots that sit one step apart in any of 8 directions (orthogonal or diagonal) automatically form a gate.
When a closed chain of your gates encloses at least one of your opponent's dots, that territory is captured: each enclosed enemy dot adds one to your score, and every cell inside the closed region — empty or occupied — becomes unplayable. Your own dots inside the region are not scored.
Closing a region that contains no enemy dots does not claim it. The chain is on the board, but the cells inside stay playable.
Captured dots stay visible on the board (faded, with an X). You may not place a new dot inside a region that has already been captured.
Dots sitting on the literal board edge are safe — they cannot be captured even when topologically enclosed. (This matches the modern competitive Dots "grounding" rule and is built into the engine.)
Passing is not allowed. Surrendering is allowed at any time and the surrendering player loses regardless of the score.
The game ends after a fixed number of moves (you choose at the start), when no playable intersection remains, or when one player surrenders. Highest capture count wins. Tie = draw.
Engine notes
This page documents the AI engine behind Kepung. Kepung is the Bahasa Malaysia name for the family of games called Kropki (Polish) or Dots internationally. The rules, terminology, and tactical patterns referenced below are drawn from the Kropki community.
Published AI research on this game family is sparse. The adjacent literature on Dots-and-Boxes (a different game with different rules) does not transfer. The most-played online engine (zagram.org) is closed-source. The notes here describe what this implementation does and how it compares to its own prior version.
Tactical patterns
- Double attack: one move that threatens two captures simultaneously
- Defend threatened: recognise own dots that are one move from being enclosed
- Pool: avoid filling own enclosed empty areas; create such areas for the opponent to be forced into late-game
Search
- Monte Carlo Tree Search with UCB1 selection
- Rollouts: pattern detectors fire first; otherwise a greedy 1-ply minimax policy; 15% random exploration
- Tree reuse: each turn retains the relevant subtree from the prior search
- Time-budgeted: 500ms–2000ms organic, scaling with position complexity
Source: github.com/Kintsugi-Design/sama_sama
Engine code: app/javascript/lib/kepung/ai/
Benchmarks (self-play, 50 games, 9×9 fill-board)
- MCTS Hard vs. Phase-1 Hard: results pending
- Phase-1 Hard vs. prior α-β Hard: results pending
Also known as Conquer, Salt, Tiga Datuk in Malaysia, and internationally as Dots.