Games
Tic-Tac-Toe
Tic-tac-toe game with AI and training mode
About this tool
Tic-tac-toe is a classic example for introducing reinforcement learning in a simple and fully observable environment. It is a two-player, zero-sum game with perfect information: both players see the entire board state, and one player's gain is the other's loss. However, instead of solving the game analytically with tree search, this approach learns how to play through experience.
The agents learn by interacting with the environment and updating their strategy based on rewards. After each game, outcomes are translated into signals (+1 win, 0 draw, −1 loss), which are propagated back through the sequence of moves. Over many self-play iterations, the agents estimate the value of each state or action and gradually improve their decisions. This process is known as reinforcement learning, and in simple settings it can be implemented using value updates or temporal-difference methods.
Unlike Minimax, which requires exploring the full game tree, reinforcement learning does not need an explicit model of all possible states. Instead, it approximates optimal play through repeated simulation. With enough training, two agents playing against each other converge to a stable strategy where neither can easily exploit the other.
This tool allows you to observe and control the learning process. The model comes pre-trained, but you can retrain it from scratch or continue training from its current state. Watch how performance evolves over time and how the agent improves through experience, eventually achieving near-optimal play.
