Board Representation & Game Engine
Encode the 3x3 board, implement move legality, win/draw detection, turn tracking, and wrap everything into a reusable Game class with hard-coded and interactive play.
Build the game engine, minimax, tabular self-play, and a DQN agent, then compare value and policy learners.
Every source step is its own lesson with intuition, concepts, correctly rendered MathJax mathematics, implementation, tests, mistakes, and a checkpoint.
Encode the 3x3 board, implement move legality, win/draw detection, turn tracking, and wrap everything into a reusable Game class with hard-coded and interactive play.
Implement a random-move agent, run head-to-head rollouts, then build a full minimax (with alpha-beta pruning) and verify optimal play against random and itself.
Design state hashing with symmetry canonicalization, hyperparameters, epsilon-greedy action selection over legal moves, reward shaping, and the full Q-learning update and episode loop with learning curves.
Train the Q-agent through self-play with perspective flipping, evaluate against random and minimax opponents, support human-vs-agent play, and save/load the Q-table.
Move from a table to a neural function approximator: encode the board for an MLP, mask illegal actions, build a replay buffer and target network, train DQN end-to-end, and compare against earlier agents.
Implement a SARSA variant, a REINFORCE policy-gradient learner, compare value-based vs policy-based methods, and accelerate learning via 8-fold symmetry data augmentation.