Skip to content

A browser Tic-Tac-Toe game where the player plays against an unbeatable bot. Written in HTML, CSS, Javascript. Click the link below to play the game.

License

Notifications You must be signed in to change notification settings

mezeirobert0/unbeatable-tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unbeatable Tic-Tac-Toe — a browser game

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

Installation

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.

Running the game

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.

About

A browser Tic-Tac-Toe game where the player plays against an unbeatable bot. Written in HTML, CSS, Javascript. Click the link below to play the game.

Resources

License

Stars

Watchers

Forks