A lightweight desktop chess simulator built completely with native Java graphical user interface frameworks. The application implements an isolated mathematical state tracker across an 8x8 matrix grid to govern turn-based dynamics, programmatic legal move highlights, collision-boundary calculations, and win-state validation structures.
The engine logic—including multi-directional boundary checking, nested array scan iterations, and real-time state mutations—was written entirely within a bare-bones environment (Notepad and the CLI) to build clean proficiency in multidimensional arrays, event dispatch loops, and object-state constraints.
- Multidimensional State Grid: Maps the logical 64-square chessboard directly to an internal 2D array matrix (
JButton[8][8]), coupling physical user elements directly with mathematical operational offsets. - Handcrafted Move-Validation Matrix: Implements discrete legal move evaluation paths for all piece groups:
- Linear Ray Scans (Rooks/Queens): Iterates horizontally and vertically across indices until encountering an opposite or matching piece boundary.
- Diagonal Vector Paths (Bishops/Queens): Compiles synchronized index tracking steps (
i--,j++) to assess geometric move vectors. - L-Shaped Displacement (Knights): Validates static mathematical index bounds checks to safely handle jumping mechanics without overflowing array limits.
- Event-Driven State Machine: Leverages a unified
ActionListenergrid interface. It captures interaction phases, handles turn verification states dynamically, toggles cell selections, and cleans validation borders smoothly across turns. - Dynamic Graphical Rendering: Manipulates native runtime assets dynamically using image token validation constraints to map visual assets smoothly over background color matrices.
- Core Technology: Java SE (Swing GUI Architecture, AWT Event Queues, Multidimensional Collections)
- Layout Management:
java.awt.GridLayout(Enforces rigid 8x8 viewport constraint ratios)
ChessBoard.java: The core standalone engine; handles initialization steps, UI rendering setups, dynamic coordinate mapping loops, collision vectors, and interactive game lifecycle endpoints.
