The Chess Team is a two player bitboard based chess game engine.
The Chess Team is a two player chess game engine that focuses on interactive gameplay. It features all common chess mechanisms, including move generation, move validation, castling, pawn promotion, draw and forfeit options. Players can also enter themselves into the leaderboard after a win, which accumulates and retains all player wins. Java Chess is written in Java, and uses Java swing for GUI. The board is represented using bitboards, making the program lightweight and fast.
- Language: Java
- GUI: Java swing
- Architecture Pattern: Model-View-controller (MVC)
- Board Representation: Bitboard
This project uses MVC pattern to deploy clean architecture. While some interdependency is unavoidable due to the nature of chess as a game, all such dependencies are contained within each layer and adhere to SOLID principles.
Use Case example: Select piece and highlight valid moves As illustrated in the image, once the user clicks, the controller registers the click and calls the use case method createHighlights(Model). This returns the spots to be highlighted, which is then passed onto the outer layers of presenter and view using interfaces for dependency injection. The user can then see the highlighted valid moves for the selected piece.
Clicking on a piece while the player's turn is active shows the places that piece can move to.
The piece can be moved to a valid position. Clicking on an invalid spot returns the player to piece selection.
Pieces can be captures in valid capture positions(For example, pawn can only move forward and capture diagonally).
If neither the king nor the rook has moved, and the king is not in check, clicking on the king shows the castling spot, two squares left or right of the king. Clicking on the square afterwards activates castling.
When the king is in check, only moves to get out of the check are allowed.
When the king cannot get out of a check, game is forfeit.
When no further progress is possible from either player, a stalemate is reached and the conclusion is a draw.
The Chess Team also features a leaderboard to record winner names and win counts.