This is a Tic-Tac-Toe game that runs in the browser, where the user plays against an unbeatable bot, that makes its moves based on the Minimax algorithm - this ensures it cannot be beaten. Ever.
Written in HTML, CSS and vanilla Javascript
If you have Git installed, clone the repository using the following command:
git clone https://github.com/mezeirobert0/unbeatable-tic-tac-toe.git
Otherwise go to the remote GitHub repository (https://github.com/mezeirobert0/unbeatable-tic-tac-toe), go to Code > Download ZIP
and unzip the folder in the desired location.
Open the project folder and double-click on index.html
.
After opening the file, the player is greeted and is asked to choose one of the sybols: X or O (keep in mind X always plays first).
As soon as the player chooses, the greet and selection buttons become invisible and the board appears. Also, it is worth noting that the bot takes about 1 second to make a move.
When the game is over, a result is displayed under the board:
- Player wins! - It is highly unlikely for the player to win, but I still added the option :)
- Bot wins!
- It's a draw!
Beneath the result, the selection buttons appear if the player wants to play another game.