GithubHelp home page GithubHelp logo

thestevendev / tictactoe-ai Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 12 KB

A TicTacToe BOT in JS with Minimax algorithm

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

HTML 10.80% JavaScript 77.13% CSS 12.06%
ai minmax-algorithm tic-tac-toe tictactoe-javascript tris

tictactoe-ai's Introduction

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.

tictactoe-ai's People

Contributors

thestevendev avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.