A downloadable game

Play backgammon like it's 1983 — with brainpower, not graphics.

PyBG is a tactical, text-based backgammon game designed for players, tinkerers, and AI researchers. Whether you're looking to play a full match, analyze dice probabilities, or train a reinforcement learning agent, this retro-styled engine has you covered.

✨ Features

  • 🎲 Full Backgammon Match Logic — doubling cube, Crawford rule, resignations, and scoring

  • ♟️ ASCII Art Game Board — rendered directly in your terminal or console

  • 🧠 Gym-Compatible RL Environment — train AI agents with valid action masking and observations

  • 🔁 Supports Backgammon, Nackgammon, and Acey-Deucy

  • 📟 Position and Match IDs — compatible with GNUBG formats

  • 👥 Human or AI Play — plug in agents or play by typing moves

  • 💡 Perfect for Learning — understand the game, teach an agent, or code your own strategy

🕹️ Controls

Everything is keyboard-driven:

  • Type commands like roll, move 6 3, double, or resign gammon

  • Navigate match history (optional)

  • Load or export position IDs for advanced analysis

🧪 For Developers & AI Researchers

  • Compatible with gymnasium and numpy

  • Exposes rich game state as structured observations

  • Legal moves are filtered using action masks

  • Designed for multi-agent training and self-play

Whether you're a backgammon fanatic, retro purist, or AI tinkerer, PyBG is your minimalist arena for strategy, stats, and showdowns.