Skip to content

A Java-based chess engine that supports Player vs Player, Player vs AI, and AI vs AI modes, using a Minimax algorithm for decision-making.

Notifications You must be signed in to change notification settings

nickvpn/java-chess-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JChess - Java Chess Engine

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.

Features

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

Example Gameplay

Here is a snapshot of AI vs AI in action:

AI vs AI Game

As well as the options available to the player:

Options

AI Algorithm

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:

Minimax Algorithm

For more on Minimax, see this guide on R-Bloggers.

Prerequisites

To run the chess engine, ensure you have the following installed:

  • Java 8 or higher

Installation

To run the project locally, follow these steps:

  1. Clone the repository to your local machine.
  2. Navigate to the src/ directory.
  3. Compile and run the Java files using your preferred Java IDE.

Credit

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.

About

A Java-based chess engine that supports Player vs Player, Player vs AI, and AI vs AI modes, using a Minimax algorithm for decision-making.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages