This project implements a Chess engine entirely in Java, supporting multiple modes of play:
- Player vs Player
- Player vs AI
- AI vs AI
You can explore the project and the codebase in the src/
folder.
- Game Modes: Play against another player or challenge the AI in single-player mode. You can also watch AI vs AI matches.
- Move Highlights: Toggle the highlighting of valid moves and the current board position.
- AI Implementation: The AI uses a Minimax algorithm to evaluate and select optimal moves, providing a challenging opponent.
Here is a snapshot of AI vs AI in action:
As well as the options available to the player:
The AI's decision-making is powered by the Minimax algorithm, with a current search depth of 4. Below is an illustration of the Minimax decision tree used to determine the best move:
For more on Minimax, see this guide on R-Bloggers.
To run the chess engine, ensure you have the following installed:
- Java 8 or higher
To run the project locally, follow these steps:
- Clone the repository to your local machine.
- Navigate to the
src/
directory. - Compile and run the Java files using your preferred Java IDE.
Special thanks to amir650 for his Chess Engine guides. You can find his repository and tutorials here. Highly recommended for anyone wanting to build a Java-based chess engine or sharpen their Object-Oriented Programming (OOP) skills.