Skip to content

adeelibr/tic-tac-toe-ai-vanilla-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe

A simple tic tac toe game build in vanilla javascript, along with some nice HTML & CSS. There are 2 implementations of this tic tac toe game one is the simple one in which both the user & the bot can win. The other is an implementation where the bot always wins or it ties. But never looses.


Vanilla Javascript Implementation

To use the simpleAi.js implementation simply go in the index.html file and at the very bottom in the script tag uncomment the line with smartAi.js. If you want to use the the one with the minimax algorithm do the opposite.

- <script src="smartAi.js"></script>
+ <script src="simpleAi.js"></script>
How To Use It
  • Clone the repository
  • Go in simple/index.html file
  • If you want to use simple 2 player (You & Dumb Bot) uncomment the script with simpleAi.js
  • If you want to use 2 player (You & Undefeated Bot) uncomment the script with smartAi.js
Things I am using
  • Minimax Alogorithm For Smart AI
  • HTML, CSS, JS, Some Es6 Sugar
Live Example

I have hosted the live example of the Smart AI Game at Codepen, [CLICK HERE]

React Implementation

Coming Soon~

About

A tic tac toe game built with vanilla javascript using minimax algorithm.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published