Git Product home page Git Product logo

ai_chessbot's Introduction

AI ChessBot

This project implements a chess-playing AI using a JavaScript-based algorithm that employs Alpha-Beta Pruning for improved efficiency during search and utilizes Piece-Square Tables for board evaluation. The AI also offers five difficulty levels set out by level searching. Additionally, it includes an HTML and CSS GUI to interact with the AI and play chess.

Table of Contents

Features

  • Chess AI using Alpha-Beta Pruning.
  • Board evaluation using Piece-Square Tables.
  • HTML and CSS GUI for playing chess against the AI.
  • Five difficulty levels based on search depth.

Prerequisites

  • A modern web browser that supports HTML5 and CSS3.
  • Basic understanding of chess rules and gameplay.

Usage

  1. Clone the repository to your local machine:
git clone https://github.com/jimmyvdw/AI_ChessBot/
cd chess-ai
  1. Open index.html in a web browser:
# Double-click on index.html
  1. Play chess against the AI using the GUI and select a difficulty level.

Algorithm Overview

The AI utilizes the Alpha-Beta Pruning algorithm, an extension of the minimax algorithm, for efficient move decision making. Alpha-Beta Pruning reduces the number of nodes evaluated in the minimax tree by disregarding branches that are guaranteed to be worse than previously evaluated branches.

Piece-Square Tables are used for board evaluation. These tables assign a value to each piece on the board based on its position. The AI calculates the overall board evaluation by summing the values of the pieces based on their positions.

Difficulty Levels

The AI offers five difficulty levels based on the search depth of the algorithm. The search depth determines how many moves ahead the AI will consider for each move. Higher difficulty levels correspond to deeper search and more complex gameplay.

  • Level 1: Shallow search - Beginner (2 moves ahead)
  • Level 2: Moderate search - Easy (3 moves ahead)
  • Level 3: Intermediate search - Normal (4 moves ahead)
  • Level 4: Advanced search - Hard (5 moves ahead)
  • Level 5: Expert search - Extreme (6 moves ahead)

File Structure

/
|-- index.html                 # HTML file for the GUI
|-- style.css                  # CSS file for styling the GUI
|-- script.js                  # JavaScript file containing the AI algorithm, board logic, and difficulty levels
|-- ...

ai_chessbot's People

Contributors

jimmyvdw avatar

Watchers

 avatar

Forkers

mertdaver

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.