How lucas-js/chess-system works
This repository is a two-player, console-based chess game. A player enters a source square, sees legal destinations, enters a target, and the match validates and applies the move until checkmate; the UI then displays the result. The match coordinates turn rules, check/checkmate, captures, promotion, castling, and en passant over a board abstraction, while piece classes calculate movement. The README is empty, so capabilities are based on the sampled source; omitted ChessMatch sections limit certainty about some internal call details.
Main entry points: ChessMatch.java Match coordinator · Program.java Game loop · ChessPiece.java Chess piece base · Board.java Board state
Components 13
Console interface
- Game loop
application/Program.java - Console UI
application/UI.java
Chess rules
- Match coordinator
chess/ChessMatch.java - Chess coordinates
chess/ChessPosition.java - Player colors
chess/Color.java - Game exceptions
chess/ChessException.java
Board and pieces
- Board state
boardgame/Board.java - Piece abstraction
boardgame/Piece.java - Grid coordinates
boardgame/Position.java - Chess piece base
chess/ChessPiece.java - Piece movement
chess/pieces - Board errors
boardgame/BoardException.java
Other components
- Player
Connections 18
- Player → Game loop: enters moves
- Game loop → Console UI: reads and displays
- Game loop → Match coordinator: requests moves
- Console UI → Chess coordinates: parses squares
- Game loop → Match coordinator: submits moves
- Match coordinator → Chess coordinates: converts squares
- Match coordinator → Board state: queries and updates
- Match coordinator → Chess piece base: checks chess state
- Match coordinator → Piece movement: initializes pieces
- Chess piece base → Piece abstraction: extends
- Piece abstraction → Board state: queries board
- Piece abstraction → Grid coordinates: uses coordinates
- Chess piece base → Player colors: stores color
- Piece movement → Board state: calculates moves from
- Piece movement → Chess piece base: specializes
- Board state → Board errors: throws
- Chess coordinates → Grid coordinates: maps to grid
- Match coordinator → Game exceptions: throws rule errors