An amazing 1P Chess Game.The Artificial Intelligence Algorithm used or Algorithm used for Engine is "NegMax Algorithm".
This is a Chess Game with Two variations.
- Player vs Player
- Player vs Computer
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.
- Press z to undo a move.
- Press r to reset the game.
- Python 3.10.5
- pygame 2.1.2
- 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.
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.
- Install Python:- To Install Python.
- Install Pygame:- To install Pygame, open the command prompt and give the command as shown below:
pip install pygame
- Clone the repository
git clone https://github.com/siddheshsingh26/ChessAI-Game.git
- Go to the project directory
cd ChessAI-Game
- Start the Game
python .\chessMainBoard.py
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