TicTacToe provides various AI agents for the Tic Tac Toe game.
This package is inspired by a blog post by Rob Heaton. As of now there are two agents implemented:
- RandomAI: makes a random legal move.
- MinMaxAI: uses the MinMax algorithm to find the optimal move.
There are three game modes to choose from:
- Human vs. Human
- Human vs. AI
- AI vs. AI
$ go get github.com/anastalaz/tictactoe
package main
import (
"fmt"
ttt "github.com/anastalaz/tictactoe"
)
func main() {
p1, p2, err := ttt.Config()
if err != nil {
fmt.Println(err)
return
}
ttt.Play(p1, p2)
}