Here is an implementation of an AI agent, TicTacPro
which plays tic-tac-toe using Monte Carlo tree search. The underlying game environment is provided by gym-tictactoe, and the agents are modeled after their example code.
# install requirements
pip install -r requirements.txt
# simulate some games
python run.py
-
The Monte Carlo Tree Search is implemented inside
agents.py
, for the AI agentTicTacPro
. -
Like the other, simpler agents,
TicTacPro
has anact
method which takes the current state & environment, and returns the move it wants to make. Each time act is called, the agent builds up a new tree. -
In
run.py
, this agent can be made to play against its historic rival,TicTacJoe
.