Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
f46af11
Implement 'captured' command
Nov 12, 2023
3c38813
Update UG
Nov 12, 2023
49caca9
Fix formatting on help menu
Nov 12, 2023
862dda0
Update README.md with new command
Nov 12, 2023
fc2e9c0
Update PPP
onx001 Nov 12, 2023
06c2aad
Update README.md
onx001 Nov 12, 2023
d33f630
Fix stepback on loaded game
ken-ruster Nov 12, 2023
9df3942
Add tests for parsePromote
ken-ruster Nov 12, 2023
579fcfb
Add test for showMoveCommand
ken-ruster Nov 12, 2023
c662f9d
Merge pull request #183 from onx001/2.1-Updates
onx001 Nov 13, 2023
6bb4d9d
Merge branch 'master' into branch-Pieces
onx001 Nov 13, 2023
98c510d
Merge pull request #184 from ken-ruster/stepback-bugfix
onx001 Nov 13, 2023
acd7a81
Merge pull request #182 from antrikshdhand/branch-Pieces
onx001 Nov 13, 2023
6f3df81
Update Documentation
onx001 Nov 13, 2023
d7da223
Merge pull request #186 from onx001/docs2
TriciaBK Nov 13, 2023
abb1446
Update puml in Developer Guide
TriciaBK Nov 13, 2023
6efa74c
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T18-1/tp …
TriciaBK Nov 13, 2023
e22f171
Update Developer Guide
TriciaBK Nov 13, 2023
de6b09a
Update Developer Guide
TriciaBK Nov 13, 2023
1c1dde6
Merge pull request #19 from AY2324S1-CS2113-T18-1/master
ken-ruster Nov 13, 2023
2680650
Update user guide
TriciaBK Nov 13, 2023
c829a78
fix checkstyle'
TriciaBK Nov 13, 2023
466b9bb
Update UG and DG
TriciaBK Nov 13, 2023
b9d5726
Add test for showMoveCommand
ken-ruster Nov 13, 2023
18b17ae
Add tests for ExecuteSavedMoves
ken-ruster Nov 13, 2023
26dc224
Correct tests for ShowMovesCommand
ken-ruster Nov 13, 2023
25f0c0a
Correct checkStyle
ken-ruster Nov 13, 2023
2e85987
Add test for executeMoveArray
ken-ruster Nov 13, 2023
ce1009c
Correct checkStyle
ken-ruster Nov 13, 2023
8b590fe
Correct CI tests
ken-ruster Nov 13, 2023
a0f0648
Update PPP
ken-ruster Nov 13, 2023
4d663ae
Update reposense
ken-ruster Nov 13, 2023
fe98b6f
Fix CI checks
ken-ruster Nov 13, 2023
d9332ac
Merge pull request #187 from TriciaBK/tricia
TongZhengHong Nov 13, 2023
33dea45
Merge pull request #188 from ken-ruster/add-tests
TongZhengHong Nov 13, 2023
74d3956
Test fix ug formatting of chessboard
TongZhengHong Nov 13, 2023
fc333cd
Merge pull request #189 from TongZhengHong/branch-fix-ug-formatting
TriciaBK Nov 13, 2023
8d5ba9a
Change ``` to html tags for code blocks
TongZhengHong Nov 13, 2023
2259860
Merge pull request #190 from TongZhengHong/branch-fix-ug-2
TriciaBK Nov 13, 2023
c0c17a5
Change to table for code block
TongZhengHong Nov 13, 2023
c750b5c
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T18-1/tp …
TongZhengHong Nov 13, 2023
360a1fd
Update documentation and class diagram
TriciaBK Nov 13, 2023
1c8da78
Update PPP
TriciaBK Nov 13, 2023
2bd7357
Merge pull request #191 from TongZhengHong/branch-fix-ug-3
TriciaBK Nov 13, 2023
56b8aba
Update PPP
Nov 14, 2023
8c7342e
Merge pull request #192 from TriciaBK/tricia
antrikshdhand Nov 14, 2023
f457f9b
Merge pull request #193 from antrikshdhand/branch-FinalChanges
ken-ruster Nov 14, 2023
0de748b
Merge pull request #21 from AY2324S1-CS2113-T18-1/master
ken-ruster Nov 14, 2023
8d75c39
Update PPP
ken-ruster Nov 14, 2023
3af0b23
Update PPP
ken-ruster Nov 14, 2023
3e31de5
Update docs
onx001 Nov 14, 2023
e28809a
Show storage file format in UG
TongZhengHong Nov 14, 2023
2ed2f11
Remove unnecessary var
TongZhengHong Nov 14, 2023
640f78c
Fix UI message for choose player color
TongZhengHong Nov 14, 2023
6afb108
Check empty spaces and delimiter in Storage class
TongZhengHong Nov 14, 2023
67be4cc
Merge pull request #195 from onx001/docs3
TongZhengHong Nov 14, 2023
aae3ad2
Merge pull request #194 from ken-ruster/add-tests
onx001 Nov 14, 2023
04e18cb
Merge pull request #196 from TongZhengHong/branch-rebust-storage
onx001 Nov 14, 2023
50c96b0
Update onx001.md
onx001 Nov 14, 2023
a7aa3a1
Fix bug with current turn in save
ken-ruster Nov 14, 2023
9fa6733
Add PPP link
TriciaBK Nov 14, 2023
59f5d20
Merge branch 'master' into add-tests
ken-ruster Nov 14, 2023
ad9de0c
Merge pull request #197 from onx001/ppp1
TongZhengHong Nov 14, 2023
aa788a2
Merge pull request #198 from ken-ruster/add-tests
TongZhengHong Nov 14, 2023
d7bb443
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T18-1/tp …
TriciaBK Nov 14, 2023
8ffe6a4
Update PPP links in AboutUs
TriciaBK Nov 14, 2023
5cae662
Minor fixes
TongZhengHong Nov 14, 2023
460dc3b
Update PPP
TriciaBK Nov 14, 2023
3d190c1
Disable loadBoard method and remove saving
TongZhengHong Nov 14, 2023
6f75922
Add link to TP Dashboard
TriciaBK Nov 14, 2023
c9dc296
Remove calls to loadBoard
TongZhengHong Nov 14, 2023
65fccd0
Fix checkstyle
TongZhengHong Nov 14, 2023
e630390
Fix checkstyle 2
TongZhengHong Nov 14, 2023
0fe9f19
Merge pull request #199 from TriciaBK/tricia
TongZhengHong Nov 14, 2023
f895863
Fix checkstyle 3
TongZhengHong Nov 14, 2023
21b3717
Merge pull request #200 from TongZhengHong/remove-chessboard-storag
onx001 Nov 14, 2023
d74d6d3
Remove json tag in code block
TongZhengHong Nov 14, 2023
bf7e53a
Fix bug with current turn in save
ken-ruster Nov 14, 2023
7a30a43
Merge pull request #201 from TongZhengHong/branch-ug-format-4
onx001 Nov 14, 2023
92a817f
Merge branch 'add-tests' of https://github.com/ken-ruster/tp into add…
ken-ruster Nov 14, 2023
640bcaf
Merge pull request #202 from ken-ruster/add-tests
onx001 Nov 14, 2023
1259479
Add gameplay link
TongZhengHong Nov 14, 2023
a4245f1
Merge pull request #203 from TongZhengHong/branch-ug-format-4
ken-ruster Nov 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Contributors

Display | Name | Github Profile | Homepage
---|:---:|:---:|:---:
![](https://avatars0.githubusercontent.com/u/22460123?s=100) | Jeffry Lum | [Github](https://github.com/j-lum/) | [Homepage](https://se.kasugano.moe)
![](https://avatars0.githubusercontent.com/u/1673303?s=100) | Damith C. Rajapakse | [Github](https://github.com/damithc/) | [Homepage](https://www.comp.nus.edu.sg/~damithch/)
Name | Github Profile
---|:---:
Antriksh Dhand | [Github](https://github.com/antrikshdhand/)
Ou Ningxiang | [Github](https://github.com/onx001/)
Oh Ken Wei | [Github](https://github.com/ken-ruster/)
Tong Zheng Hong | [Github](https://://github.com/TongZhengHong/)
Tricia Boo Koh | [Github](https://://github.com/TriciaBK/)
# I would like to join this list. How can I help the project

For more information, please refer to our [contributor's guide](https://oss-generic.github.io/process/).

For more information, please refer to our [contributor's guide](README.md#contributing).
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ A summary of user commands can be found in the table below:
| Pieces legend | `legend` |
| History | `history` |
| Step back | `stepback` |
| Abort | `abort` |
| List pieces | `captured` |
| Exit | `exit` |

Please visit our [User Guide](https://ay2324s1-cs2113-t18-1.github.io/tp/UserGuide.html) for further details on each
of these commands.
Expand Down
14 changes: 7 additions & 7 deletions docs/AboutUs.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# About us

| Name | ID | Github |
|-----------------|-----------|---------------|
| Antriksh Dhand | A0278458J | antrikshdhand |
| Oh Ken Wei | A0251850J | ken-ruster |
| Ou Ningxiang | A0249445W | onx001 |
| Tong Zheng Hong | A0251819Y | TongZhengHong |
| Tricia Boo Koh | A0264665U | TriciaBK |
| Name | ID | Github |
|--------------------------------------|-----------|---------------|
| [Antriksh Dhand](team/antrikshdhand.md) | A0278458J | antrikshdhand |
| [Oh Ken Wei](team/ken-ruster.md) | A0251850J | ken-ruster |
| [Ou Ningxiang ](team/onx001.md) | A0249445W | onx001 |
| [Tong Zheng Hong](team/tongzhenghong.md) | A0251819Y | TongZhengHong |
| [Tricia Boo Koh](team/triciabk.md) | A0264665U | TriciaBK |
51 changes: 33 additions & 18 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,26 @@ Our application also uses other classes to store information about the chess gam

### ChessMaster component

<!-- Here is a partial class diagram of ChessMaster. -->

The sequence diagram below illustrates the interactions within the ChessMaster component, when they launch the program.
The sequence diagram below illustrates the interactions within the ChessMaster component, when they launch the program.
The user has the option to terminate the game anytime during this interaction with `exit`, however, this event is not depicted in the diagram for simplicity.

![](images/ChessMasterSequence.png)

How does ChessMaster component work:

1. Attempts to load previously stored game in storage
2. If previous game exists, asks the user if a new game or the previous game should be loaded.
3. If a new game is selected, the user will be prompted for the color to start.
4. Start running the new or previous game instance.
3. If a new game is selected, the user will be prompted for the color and difficulty to start.
4. Start running the new or previous game instance.

### Game component

The sequence diagram below illustrates the interactions within the Game component, taking a move of "a2 a3" as example.
The sequence diagram below illustrates the interactions within the Game component.

![](images/GameSequence.png)

How does the Game component work:
1. Solicits input from user. Users can provide game commands, if not recognised, it will parsed as a `MoveCommand`.
1. Solicits input from user. Users can provide game commands, if not recognised, it will parse as a `MoveCommand`.
2. The returned command will be executed.
3. If user entered a game command (not MoveCommand), the next user input will be solicited.
4. If a MoveCommand is identified, the user's input will be parsed as a Move object with checks to ensure it is a valid move on the chessboard.
Expand All @@ -70,6 +69,7 @@ How does the Game component work:

### User input handling
Below is a class diagram representing the Command and Parser classes.

![](images/ParserCommandDiagram.png)

In order to handle user input into the program during the game, the `Parser` class was implemented.
Expand Down Expand Up @@ -118,8 +118,10 @@ How the minimax algorithm works:
5. The `getBestMove` method returns the best move for the CPU to make.

### Move types
The Move class and its subclasses are responsible for handling the different types of moves in chess. The Move class is an abstract class that is extended by the following subclasses: StandardMove, PawnOpening, CastleMove, EnPassantMove and PromotionMove. The Move class is also extended by the following classes: CastleSide, Direction, MoveDirection, MoveType and PromotionPiece.
Below is a class diagram representing the Move class.
The Move class and its subclasses are responsible for handling the different types of moves in chess. The Move class is a parent class of several move types: CastleMove, EnPassantMove and PromoteMove. The MoveFactory class is responsible for generating the correct move type.

Below is a class diagram representing the parent Move class.

![](images/MoveClass.png)

#### Standard moves
Expand All @@ -132,6 +134,9 @@ How standard moves are generated:
4. Any chess piece that "blocks" the path of the chess piece is checked for colour. If the chess piece is of the same colour, the chess piece cannot move past it. If the chess piece is of the opposite colour, the chess piece can capture it. For example, a rook can capture an enemy chess piece in the up, down, left and right directions. (Note that pawn moves are an exception to this rule. Pawn pieces can only capture enemy chess pieces in the forward diagonal directions.)
5. Special cases such as castling, en passant and promotion are also encoded as `directions` and executed separately with different move functions.

Below is a sequence diagram representing the process of generating and executing moves.

![](images/MoveSequence.png)

#### Pawn Opening
A pawn opening is a special type of move that involves moving a pawn from its starting position to another tile two spaces ahead. This move is only valid if the pawn is in its starting position and the tile it is moving to as well as the tile in between is empty.
Expand All @@ -146,27 +151,36 @@ En passant is a special type of move that involves capturing a pawn that has jus
Promotion is a special type of move that involves promoting a pawn to another piece. This move is only valid if the pawn is in the correct position, which is at the other end of the board from which it starts. This information is implemented in the Pawn class and executed with the PromotionMove class.



### Storage Component
**API:**

Below is a class diagram representing the Storage class.
The Storage component is responsible for handling the storage and retrieval of chess game state.

![](images/StorageClass.png)

Below is a sequence diagram of the storage class.
It includes only the more essential methods (createChessmasterFile, saveBoard, loadBoard, resetBoard) required for the main storing and loading of information, to prevent the diagram from being too complex.

![](images/StorageSequence.png)

* Creates the necessary parent directories for the file and the file itself if they don't exist
* Saves the current state of the ChessBoard to the file. It includes the player's color information and current player's turn as the first line and the state of the chessboard in an 8x8 format.
* Allows resetting the game by clearing the contents of the file.
* Loads the state of the chessboard from the file by constructing a 2D array of ChessTile objects.
Here is a brief overview of how the storage handles the data storage:
1. For the storing of information, it creates the necessary parent directories for the file and the file itself if they don't exist
2. In the text file, the following contents are stored in order, each taking up a line:
1. Player's color information
2. Game difficulty
3. Color of the next player (the color to be played upon the loading of game)
4. Human player's past moves in the form of comma-separated string
5. CPU's past moves in the form of comma-separated string
6. State of the chessboard in an 8x8 format, taking up 8 lines.
3. For the loading of information the above saved information are loaded (Player's color, game difficulty, next turn's color, player's moves, CPU's moves and board state)
4. To ensure data is not corrupted, the executeSavedMoves method parses the saved player's moves and CPU's moves to check against the saved board state
5. Other features include resetting the game by clearing the contents of the file.


## Product scope
### Target user profile

1. Novice players trying to practice chess and play chess offline without a chess set.
2. Time-poor users looking for a very simple, clean, gimmick-free chess application.

### Value proposition
- Chess novices can use ChessMaster CLI to learn the game's rules and practice their skills.
- Busy students can open the application up in their terminal easily for a quick game of chess.
Expand All @@ -187,8 +201,9 @@ The Storage component is responsible for handling the storage and retrieval of c
| v1.0 | player | save and get back to a game | leave when I am busy and resume a game when I am free |
| v2.0 | new player | see available moves for a piece | learn the rules of chess and valid moves |
| v2.0 | new player | refresh the rules of chess anytime | recap and learn the rules of chess |
| v2.0 | player | see past move history | recap through the gameplay |
| v2.0 | player | see captured pieces | gauge the state of the game |

{more to be added}

## Non-functional requirements

Expand Down
Loading