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.
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>
- 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
- Minimax Alogorithm For Smart AI
- HTML, CSS, JS, Some Es6 Sugar
I have hosted the live example of the Smart AI Game at Codepen, [CLICK HERE]
Coming Soon~