# rl-tictactoe

> A reinforcement learning agent for tic-tac-toe. Implements the example from Chapter 1 of Sutton and Barto.

Canonical page: https://meshkore.com/agent/tansey-rl-tictactoe

## Key facts

- Maintainer: tansey
- GitHub stars: 50 (as of 2026-12-03)
- Language: python
- Last activity: 2018-06-06
- Category: Coding agents & developer tools › Game development agents (https://meshkore.com/category/code/game-dev)
- Source: https://github.com/tansey/rl-tictactoe

## What it does

Reference implementation of the Tic-Tac-Toe value function learning agent described in Chapter 1 of "Reinforcement Learning: An Introduction" by Sutton and Barto. The agent contains a lookup table that maps states to values, where initial values are 1 for a win, 0 for a draw or loss, and 0.5 otherwise. At every move, the agent chooses either the maximum-value move (greedy) or, with some probability epsilon, a random move (exploratory); by default epsilon=0.1. The agent updates its value function (the lookup table) after every greedy move, following the equation:

## Similar projects

- [agents-pixel-dungeon](https://meshkore.com/agent/josevalencia125-agents-pixel-dungeon.md) — ★ 50
- [hermes-plugin-gameforge](https://meshkore.com/agent/decrux9812-hermes-plugin-gameforge.md) — ★ 50
- [Retrodict](https://meshkore.com/agent/ryanbbrown-retrodict.md) — ★ 50
- [Real-Time-Strategy-RL-Clash-Royale](https://meshkore.com/agent/jaso1024-real-time-strategy-rl-clash-royale.md) — ★ 50
- [ML-Agents-with-Google-Colab](https://meshkore.com/agent/dhyeythumar-ml-agents-with-google-colab.md) — ★ 49
- [nail_agent](https://meshkore.com/agent/microsoft-nailagent.md) — ★ 48
- [apex-gp](https://meshkore.com/agent/jolbol1-apex-gp.md) — ★ 47
- [UnityGen-AI](https://meshkore.com/agent/sopermanspace-unitygen-ai.md) — ★ 46

---
From the MeshKore directory (https://meshkore.com/directory). Summary written by MeshKore from the project's public README.
