A professional console-based chess game implemented in Java.
Demonstrates strong object-oriented design, game logic implementation, and interactive console features.
This project showcases:
- Object-Oriented Programming: Each chess piece is a separate class implementing
isValidMove(). - Core Game Logic: Full chess rules including castling, en passant, pawn promotion, check, and checkmate detection.
- Interactive Console Interface: Move timer (30 seconds per move).
- Clean Code & Structure: Designed for easy extension to GUI, AI opponent, or networked multiplayer.
This demonstrates skills relevant for Java development, game development, and algorithmic problem solving.
- Standard chess rules (movement, check, checkmate, stalemate)
- Pawn promotion with choice of Queen, Rook, Bishop, or Knight
- Castling (king-side and queen-side)
- En passant capture
- Move timer (30 seconds per move)
- Move history tracking
- Easily extendable for GUI or network play
src/main/java/com/example/chess/
βββ ConsoleMain.java # Entry point of the console game, handles user interaction
βββ logic/
β βββ GameLogic.java # Core game rules, move validation, special moves
β βββ Move.java # Representation of a move, coordinates and promotion
βββ model/
βββ Piece.java # Abstract base class for all chess pieces
βββ Pawn.java # Pawn implementation, including movement and en passant
βββ Rook.java # Rook implementation, including castling logic
βββ Knight.java # Knight movement implementation
βββ Bishop.java # Bishop movement implementation
βββ Queen.java # Queen movement implementation
βββ King.java # King movement implementation, including castling
- Language: Java 24 (OpenJDK, latest stable version used during development)
- Object-Oriented Design:
- Each chess piece (Pawn, Rook, Knight, Bishop, Queen, King) is implemented as a separate class inheriting from the abstract
Piececlass. - The
GameLogicclass handles all game rules, validations, special moves, and game state.
- Each chess piece (Pawn, Rook, Knight, Bishop, Queen, King) is implemented as a separate class inheriting from the abstract
- Move Validation:
- Each piece implements its own
isValidMove()method. - Supports standard chess movement rules, including diagonal, horizontal, vertical, and knight jumps.
- Each piece implements its own
- Special Moves:
- Castling: King-side and Queen-side, with automatic rook movement.
- En Passant: Captures handled according to chess rules.
- Pawn Promotion: Supports promotion to Queen, Rook, Bishop, or Knight, selectable by the player.
- Game State Tracking:
- Keeps track of current player turn (white/black).
- Detects check, checkmate, and stalemate conditions.
- Maintains move history for potential future features like undo/redo.
- Timers:
- Interactive 30-second move timer implemented for console gameplay.
- Scalability & Extensibility:
- Code structured for easy extension to GUI, AI opponent, or networked multiplayer.
- Clean separation of concerns between model (pieces), logic (game rules), and interface (console).
- Coding Standards:
- Clean, readable, and maintainable code following modern Java practices.
- Fully uses type safety, encapsulation, and modular design.
- Tools & Environment:
- Developed using IntelliJ IDEA (latest 2025 version)
- Compiled and tested with OpenJDK 24
- Cross-platform compatibility (Windows, Mac, Linux)
- Add GUI using JavaFX or Swing
- Add AI opponent
- Add networked multiplayer
- Add undo/redo move functionality