Git Product home page Git Product logo

chessai-game's Introduction

ChessAI-Game

An amazing 1P Chess Game.The Artificial Intelligence Algorithm used or Algorithm used for Engine is "NegMax Algorithm".

📝 Description

This is a Chess Game with Two variations.

  • Player vs Player
  • Player vs Computer

Summary

ChessAI is game in which 1P game works on NegMax algorithm .In this game one can set the variaton he/she want to play.The Difficulty of the game varies from 1 to 4 depending on the PC of user.The difficulty is basically the depth or how much moves Ahead does the AI calculte the possiblities .AI make a move on the basis of Net Score.This score is Calculated by giving a particular value to each piece and on the Position of the piece located at on chess board.Position Score of that square is different for different pieces .As we know all pieces should move towards the center ,so center square are given more points and so on.

This was a short summary of working of chess Game.

Some Extra Features

  • Press z to undo a move.
  • Press r to reset the game.

NegMax Algorithm Flowchart

🖼 Screenshots

Board

Mid Game

Oposo Move

Castling

All Possible move of a piece

🤖 Technology Stack

  • Python 3.10.5
  • pygame 2.1.2

Resources

🔮Future Work

  • Creating a Board.
  • Positioning Pieces.
  • Legal Piece Movements.
  • En-passant & Castle Moves.
  • Two Player Game.
  • One Player Game using NegMax Algorithm.
  • Stalemate on 3 repeated moves or 50 moves without capture/pawn advancement.
  • More Efficient(Depth > 6).
  • Making App & Website For Playing.

How to change Difficulty & selection of type of game

If you have a powerful/weak computer, try upping/lowering the depth parameter of the NegMax Algorithm. To do this, navigate to the "chessAI.py" file in the project directory, and locate the Variable name "DEPTH". Once there, you can increase/decrease the range as per your PC. I Would recommend to Play till Difficulty level or depth 4 , Max to Max 5. As we level increase the Game decome slower and slower.

To select the type of game you should navigate "chessMainBoard.py" line number 50.

🛠️ Project Setup

  1. Install Python:- To Install Python.
  2. Install Pygame:- To install Pygame, open the command prompt and give the command as shown below:
  pip install pygame
  1. Clone the repository
  git clone https://github.com/siddheshsingh26/ChessAI-Game.git
  1. Go to the project directory
  cd ChessAI-Game
  1. Start the Game
   python .\chessMainBoard.py

Project Timeline

gantt
        Chess Board:a, 2022-08-14, 1w
        Pieces movements: b,after a,10d
        Legal Piece Moves: c, after b, 9d
        Animations & Bug Fixing: d , after c , 10d
        Chess AI: e , 2022-09-17 , 10d

👩‍💻Authors

chessai-game's People

Contributors

siddheshsingh26 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.