I wonder if there are any programmers who have never thought of writing a game AI.
Often, Tic-Tac-Toe is one of those first games that come to mind. So, it was for me too.
Today, am so grateful to say that, i finally had my dream come true.
I wrote an AI that plays Tic-Tac-Toe. And it works !
It can be found at github.com/jjkavalam/tic-tac-toe
A few notes:
- It is written in Golang ! Golang is great ! Thank you Zendesk for making me learn it.
- The algorithm uses Minimax. The heart of the algorithm is documented in
logic.go
- The implementation of minimax can be different and perhaps more elegant. Refer to this project for a different take on it.