About the project
This is a browser-based Tic-Tac-Toe game made with HTML, CSS and JavaScript.
I built the AI myself instead of using an external AI service. The project started with a simple random bot and gradually became more advanced.
There are four difficulty levels: Easy, Medium, Hard and Impossible.
How to play
You play as X and the AI plays as O.
Click an empty square to make your move. The AI will then make its move. Get three of your symbols in a row to win.
AI levels
Easy
The bot picks an available square randomly. It doesn't really try to beat you.
Medium
The bot checks for winning moves and blocks the player when necessary. It also prefers the center and corners.
Hard
This level uses the Minimax algorithm. The bot looks ahead at possible moves before deciding.
Impossible
This is the strongest bot in the game. It uses reinforcement learning to learn which moves are better from different board states.