Skip to content

A TicTacToe BOT in JS with Minimax algorithm

Notifications You must be signed in to change notification settings

TheStevenDev/TicTacToe-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe Bot

Live Demo link: https://thestevendev.github.io/TicTacToe-AI/

This is a simple Tic-Tac-Toe game with an AI bot implemented in JavaScript. The bot uses the Minimax algorithm to make intelligent moves and plays against a human player.

How to Play

To play the game, follow these steps:

  1. Open the index.html file in a web browser.
  2. The game board will be displayed with empty cells.
  3. Click on an empty cell to make your move.
  4. The bot will automatically make its move.
  5. Continue taking turns until a player wins or the game ends in a tie.
  6. To start a new game, refresh the page.

Implementation Details

The game is implemented using JavaScript, HTML, and CSS. The board is represented as an array, and the AI bot uses the Minimax algorithm to determine the best move. The winning combinations are checked after each move to determine if a player has won the game. The game interface is styled with basic CSS.

File Structure

The project files are organized as follows:

  • index.html: The main HTML file containing the game structure.
  • style.css: The CSS file for styling the game interface.
  • script.js: The JavaScript file containing the game logic and AI bot implementation.

License📖

This project is licensed under the MIT License. Feel free to use and modify it for your own purposes.

About

A TicTacToe BOT in JS with Minimax algorithm

https://thestevendev.github.io/TicTacToe-AI/

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published