Java Chess & Checkers
A Java Swing game engine implementing Chess and Checkers from scratch — with full rule enforcement (Castling, En Passant, Mandatory Captures) and a CPU opponent.
Java Chess & Checkers Engine
A pure Java implementation of classic board games, prioritizing Clean Architecture and Object-Oriented Design.
This project was built to master the fundamentals of Software Architecture without relying on modern game engines.
Architecture: Strict OOP
The core strength of this engine is its adherence to Object-Oriented Designing Principles:
- Polymorphism: A base
Piececlass defines movement contracts. Subclasses likeBishop,Knight, andKingimplement specific move validation logic. - Encapsulation: Game states (Check, Checkmate, Stalemate) are isolated from the rendering logic.
- Inheritance: Shared logic between Chess and Checkers is abstracted to reduce code duplication.
Intelligent Game Logic
Move Validation
The engine doesn't just "move pieces"; it simulates the board state to prevent illegal moves (e.g., you cannot make a move that leaves your King in check).
- Chess: Handles En Passant, Castling, and Pawn Promotion.
- Checkers: Strict enforcement of Mandatory Captures and Multi-Jump chains.
CPU Opponent
A single-player mode that evaluates board states to make valid moves against the player.

Custom Swing GUI
Instead of using standard buttons, I implemented a custom Graphics2D rendering pipeline.
- Smooth Rendering: Double-buffered painting to prevent flickering.
- Drag & Drop: Intuitive mouse interaction for picking up and placing pieces.
- Dynamic Highlighting: Visual cues for valid moves (Green) and captures (Red).
