The authors of this project were inspired by great men such as ― Bernard Kelvin Clive and Mahatma Gandhi. Mahatma Gandhi advocated non-violence and Bernard Kelvin Clive once said
The global pandemic has lead to a big online chess boom. With large parts of the population in lockdown, chess has become a popular pastime and coping mechanism. Chess.com, a social network and chess server website, has added around 1 million new members each month since the lockdowns began in March, and around 2.8 million in November alone. In the same month, over 78 million standard chess games took place on lichess, a free online chess server, compared to half as many in November 2019. Chess is on its way to become one of the most popular sports as we see millions of people join these online platforms to improve their play.
The authors spent plenty of time (7 mins to be precise) in designing the solution. We are proud to present to you Maya, A chess engine that helps you get terrible at the game by playing the absolute worse moves. In a world where people are trying to get better at the game. Stand out by working to play the game nastily .
The primary concern of chess-ai is the decision-making part of the application. All functionality outside the scope of the AI are implemented using external libraries:
- Chessboard GUI: Using the chessboard.js API
- Game Mechanics: Using the chess.js API
The AI uses a modified version of the minimax algorithm, which is optimised by alpha-beta pruning. It wouldn't really be fair to call it minimax algorithm anymore, a more apt-name would be minmin algorithm .
The evaluation function uses piece square tables adapted from Sunfish.py, and eliminates the need for nested loops by updating the sum based on each move instead of re-computing the sum of individual pieces at each leaf node.
A global sum is used to keep track of black's evaluation score after each move, which is used to display the 'advantage' bar.
-
Head over to https://mayachess.herokuapp.com/ .
-
Play as white by dragging a piece to your desired location. The AI plays as black. The AI's minimax search depth (which is directly related to how bad it will play) can be customised using the 'Search Depth (Black)' dropdown. Using a higher value will improve the AI's accuracy, but it will take longer to decide on the next move.
-
To pit the AI against itself, click the 'Start Game' button under Computer vs. Computer. You can stop the game at any time using the 'Stop and Reset' button.
- Wikipedia.com for the chess pieces
- https://www.freecodecamp.org/news/simple-chess-ai-step-by-step-1d55a9266977/
- https://www.thechesswebsite.com/chess-openings/
- https://github.com/geohot/twitchchess
- https://github.com/zeyu2001/chess-ai
- https://en.wikipedia.org/wiki/Minimax
- https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning
- https://www.chessprogramming.org/Piece-Square_Tables
Use of this project is governed by the MIT License.
Special thanks to all our supporters <3: