https://github.com/haidermalikk/chess
My Chess Game Made with Pygame. The game includes a chess game engine, chess bot and its smart move finder. The game can be played with another person or a Chess bot powered by powerful algorithms and data. ELO: 1200
https://github.com/haidermalikk/chess
ai algorithms chess chess-ai chess-engine chess-game pygame python
Last synced: about 1 month ago
JSON representation
My Chess Game Made with Pygame. The game includes a chess game engine, chess bot and its smart move finder. The game can be played with another person or a Chess bot powered by powerful algorithms and data. ELO: 1200
- Host: GitHub
- URL: https://github.com/haidermalikk/chess
- Owner: HaiderMalikk
- Created: 2024-02-04T04:47:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-08T21:07:16.000Z (11 months ago)
- Last Synced: 2025-03-26T04:51:10.458Z (6 months ago)
- Topics: ai, algorithms, chess, chess-ai, chess-engine, chess-game, pygame, python
- Language: Python
- Homepage:
- Size: 1.32 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
- Chess Engine + Bot + GUI
My Chess Game. Made with Pygame, it can be played with another person or a Chess bot, powered by powerful algorithms and data structures to make it a challenging opponent.
About: This chess game has 3 files:
- Engine: The engine includes the board, rules, and moves a player can make, including the bot.
- SmartMoveFinder: This is the AI bot that determines the best moves based on board position, piece value, and the current game state.
- Main: This runs the code, checks for input, and handles all the UI.About Chess Bot: This bot is smart! I have mapped each spot on the board and assigned it a value based on how good I think it is inside the chess engine. Each piece is given a value based on its importance. The game state informs the bot of the board layout, its moves, and pieces under attack, giving it all the knowledge it needs to make a move.
This bot uses algorithms like MinMax recursion, NegaMax, Alpha-Beta Pruning, and greedy algorithms to effectively pick a move. It scans the board, evaluates every move, considers every possible state the board can be in, and assesses all opponent moves. During each recursion, it uses its knowledge of the board and pieces to choose the highest-value move.
One thing that makes this bot fast and efficient is Alpha-Beta Pruning. Earlier, I mentioned that the bot looks at every move and game state. But what if there's a move or game state that has the highest value? For example, if one move allows the bot to capture a queen with a pawn or capture a pawn with a pawn, the bot knows from piece values that capturing the queen is the best move. It stops searching for more moves and game states and takes that move immediately.
If you want to play, download the folder and run the main file. NOTE: you need Pygame installed in your Python workspace just use pip install pygame in you terminal, go get pip just do python3 i pip but this might vary. OK, BYEE!
- Here are some pics of the game PLZ NOTE: all the effort was for the back end!
- Here is the link to the live demo: https://www.youtube.com/watch?v=lJkVwCNmqOE
![]()
![]()
![]()