Skip to content

Daniel-Xu/Tic-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe

simple game with AI

If both players are playing with an optimal strategy, every game will end in a tie.

Rule

First player is the first option, second player is the second option.

You can choose which one to be 'Real Person'

The online link

Strategy

The program work correctly without addtional knowledge, but the first step will make deep function call stack,

so it's better to make our AI knowledge based.

  • if one player fills the center, the other should choose one of the corners

  • if one player fills one of the corners, the other should choose the center

  • if one player fills one of the four edges, the other one should choose cell that are in the same row or column with the chosen one.

Algorithm

MinMax: here is a good post about how the algorithm works

How to use

You can clone to your Desktop:

git clone [email protected]:Daniel-Xu/Tic-Tac-Toe.git 

Then, in the directory:

cd Desktop 

Run node.js command:

http-server .

Issue Driven

If you want to know how the project grows, go to the repository issues, and don't forget to checkout the commit message good luck!

Pic

Tic-Tac-Toe

About

simple game with AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published