Skip to content

An implementation of a Q learning agent which beats any opponent in tic tac toe.

Notifications You must be signed in to change notification settings

akirakudo901/tic-tac-toe-qtable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Tic tac toe agent playing optimally using a Q table

This repo implements a Q-table learning agent which learns iteratively to choose the best strategy against a minimax computer (which itself plays optimally), such that it ultimately draws every game!

  • ai_training.py - Executes the Q-table agent learning when run.
  • environment.py - Specifies the reinforcement learning environment (Tic tac toe game) in which we train the agent.
  • minimax.py - Builds a minimax computer algorithm which plays optimally in a game of Tic tac toe.
  • play_tictactoe.py - A console version that makes use of environment.py to allow playing a game of Tic tac toe against either a trained q-table agent or a minimax agent.
  • qtable.py - A class describing the Q-table used by the Q-learning agent.

About

An implementation of a Q learning agent which beats any opponent in tic tac toe.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages