CSC207-2023Y-UofT / course-project-thechessteam

course-project-thechessteam created by GitHub Classroom
1 stars 2 forks source link

Front page

The Chess Team

The Chess Team is a two player bitboard based chess game engine.

Table of contents

Game interface

About The Project

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.

Build Details

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. MVC

Use Case example: Select piece and highlight valid moves MVC 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.

Features

Selecting a piece and show valid moves

Clicking on a piece while the player's turn is active shows the places that piece can move to.

Move a piece

The piece can be moved to a valid position. Clicking on an invalid spot returns the player to piece selection.

Capture pieces

Pieces can be captures in valid capture positions(For example, pawn can only move forward and capture diagonally).

Castling

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.

Check

When the king is in check, only moves to get out of the check are allowed.

Checkmate

When the king cannot get out of a check, game is forfeit.

Stalemate

When no further progress is possible from either player, a stalemate is reached and the conclusion is a draw.

Draw

Leaderboard

Forfeit

Leaderboard

Leaderboard

The Chess Team also features a leaderboard to record winner names and win counts. Leaderboard