Logo Lanfrica
  • Accueil
  • Atlas
  • Analyses
  • Documentation
  • Sign in

© 2026 Lanfrica. Tous droits réservés. Tous les droits d'auteur des ressources affichées sur le site Web Lanfrica appartiennent aux détenteurs de droits d'auteur d'origine, sauf indication contraire explicite.

ChahineDerbali/RL-Tunisian-XO

Type de record:

model
Créateur:
Cha
Hôte:
# Tunisian XO — Reinforcement Learning Project This project implements a **Reinforcement Learning (RL)** agent that learns to play the **Tunisian version of XO (Tic-Tac-Toe)**. Unlike the classic game, each player: - Places **exactly 3 pieces** during an initial placement phase - Then **moves** pieces according to specific movement rules until a winner is found The goal of the project is educational: to model the game as an MDP and apply **tabular Q-learning** with self-play. --- ## Game Rules (Tunisian XO) ### Board - 3×3 grid ### Phase 1 — Placement - X and O alternate placements - X places 3 pieces, O places 3 pieces - Order: X → O → X → O → X → O - If a player wins during placement, the game ends ### Phase 2 — Movement - X always starts moving first - Players alternate moving **one** of their pieces - Allowed moves: - Horizontal and vertical adjacency - Diagonal moves **only** between center and corners - After each move, a win is checked ### End Conditions - One player forms 3 in a row → win - Maximum number of moves reached → draw --- ## Reinforcement Learning Design ### State - Board configuration (9 cells) - Number of pieces placed by X and O - Current player ### Actions - Placement: `("P", cell_index)` - Movement: `("M", from_cell, to_cell)` ### Learning Algorithm - **Tabular Q-learning** - Two separate Q-tables: - `Q_place` for placement actions - `Q_move` for movement actions ### Training Strategy - **Self-play with frozen snapshots** - The agent trains against a periodically frozen version of itself - Exploration via ε-greedy policy with slow decay --- ## Project Structure ``` tunisian_xo_rl/ │ ├── env.py # Game environment (rules + transitions) ├── train.py # Self-play training loop ├── play.py # Human vs trained agent ├── main.py # CLI entry point │ ├── agents/ │ ├── q_agent.py # Q-learning agent (placement + movement) │ ├── random_agent.py # Random baseline │ └── human_agent. …

Visit

github.com

Similaires

hannie-xo/EA-Bank-Usagerl-institut/NESP2Jordan-Leis/Microgrid-RLsurrey-nlp/ALOPE-RLCIRCA-RL-GHANA/RootKhamies/IndabaX-Rwanda-RL

hannie-xo/EA-Bank-Usage

An application to predict bank users across East Africa

rl-institut/NESP2

Webmap (using leaflet) for visualizing village cluster identification and prioritization for off-gri

Jordan-Leis/Microgrid-RL

Benchmarking deep reinforcement learning algorithms for autonomous energy management in off-grid sol

surrey-nlp/ALOPE-RL

A policy-based RL framework for Quality Estimation of Machine Translation on low-resource languages.

CIRCA-RL-GHANA/Root

Root Files # PROMPT Genie **Version:** 1.0.0 · **Status:** Production Multi-role super-app for Wes

Khamies/IndabaX-Rwanda-RL

RL tutorial for IndabaX Rwanda 2019 # IndabaX-Rwanda-RL Tutorial RL tutorial for IndabaX Rwanda @20