A fully functional chess application written in Java. This project features a graphical user interface (GUI) built with Java Swing, a comprehensive chess rules engine, and a Minimax-based AI opponent.
- Graphical User Interface: A clean, interactive chess board built using Java Swing (
ui.ChessUI). Features include moving pieces via drag-and-drop or click-to-move, and a move history panel. - Chess Rules Engine: Complete implementation of chess rules including valid piece movements, checkmate, stalemate, and special moves like castling and en passant (
logic.MoveGenerator). - AI Opponent: Play against the computer! The engine includes an AI bot using the Minimax algorithm (
bot.Minimax). - Move History: Tracks and displays game moves using standard algebraic notation (
logic.MoveHistory,logic.ChessNotation). - Object-Oriented Design: Cleanly separated architecture:
model: Data structures representing theBoard,Piece, andMove.logic: Core game mechanics, move generation, and state management (GameManager).bot: AI logic.ui: The graphical presentation layer.
chessBot/
├── Main.java # Application entry point
├── bot/ # AI logic (Minimax algorithm)
│ ├── Bot.java
│ └── Minimax.java
├── logic/ # Game rules and state management
│ ├── ChessNotation.java
│ ├── GameManager.java
│ ├── MoveGenerator.java
│ └── MoveHistory.java
├── model/ # Chess data models
│ ├── Board.java
│ ├── Move.java
│ └── Piece.java
└── ui/ # Graphical user interface
└── ChessUI.java
- Java Development Kit (JDK) 8 or higher.
- Navigate to the
chessBotproject root directory. - Compile the Java files:
javac Main.java bot/*.java logic/*.java model/*.java ui/*.java
- Run the application:
java Main
This project has been developed iteratively, starting from basic move validation and progressing towards a fully playable game with high-quality Unicode chess symbols, robust checkmate/stalemate detection, and a functional API/bot integration.