Swapped the random-move players for actual Q-learning.
Instead of both sides just picking randomly, moves now come from an epsilon-greedy policy: mostly pick the best known move for the current board state, occasionally pick a random one to keep exploring. Added state encoding (board from the current player’s perspective, so X and O see it the same way), a Q-value table, and updates after every move based on the reward (win, loss, or draw).
Also added saving and loading the trained table to q_table.json so training runs don’t have to start from zero, train.py now loads it in on startup.
Next step is actually building a playable UI.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.