Skip to content

TicTacToe provides various AI agents for the Tic Tac Toe game.

License

Notifications You must be signed in to change notification settings

anastalaz/tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TicTacToe gopherbadger-tag-do-not-edit GoDoc Go Report Card

TicTacToe provides various AI agents for the Tic Tac Toe game.

About

This package is inspired by a blog post by Rob Heaton. As of now there are two agents implemented:

  1. RandomAI: makes a random legal move.
  2. MinMaxAI: uses the MinMax algorithm to find the optimal move.

There are three game modes to choose from:

  1. Human vs. Human
  2. Human vs. AI
  3. AI vs. AI

Tic Tac Toe demo gif

Installation

$ go get github.com/anastalaz/tictactoe

Example

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)
}

About

TicTacToe provides various AI agents for the Tic Tac Toe game.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages