Skip to content
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
634 commits
Select commit Hold shift + click to select a range
9fc8c13
Merge pull request #115 from onx001/StartBug
TongZhengHong Nov 3, 2023
70b7003
Fix minimax aggro
onx001 Nov 4, 2023
e0159f0
Update MiniMax.java
onx001 Nov 4, 2023
f2e8235
Merge pull request #116 from onx001/Check
TongZhengHong Nov 4, 2023
10847a1
Merge pull request #149 from onx001/MinimaxAggro
TongZhengHong Nov 4, 2023
37cbf93
Update no available moves ui
TongZhengHong Nov 4, 2023
3268804
Fix empty payload in ShowMovesCommand
TongZhengHong Nov 4, 2023
98331c4
Fix wrong color when player loses
TongZhengHong Nov 4, 2023
c0b3577
Convert code blocks from markdown to html
TongZhengHong Nov 4, 2023
0fe8b95
Fix link to legend command
TongZhengHong Nov 4, 2023
80e109a
Merge pull request #152 from TongZhengHong/fix-ug-formatting
onx001 Nov 4, 2023
f17486a
Merge pull request #151 from TongZhengHong/fix-wrong-losing-color
onx001 Nov 4, 2023
dc3668c
Merge pull request #150 from TongZhengHong/fix-moves-command
onx001 Nov 4, 2023
f7838f2
Add InvalidCommand class
TongZhengHong Nov 5, 2023
7eb0f9e
Update NullPieceException message
TongZhengHong Nov 5, 2023
f8a7b35
Check for empty move
TongZhengHong Nov 5, 2023
714d012
Merge pull request #15 from AY2324S1-CS2113-T18-1/master
ken-ruster Nov 5, 2023
d82392e
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T18-1/tp
TriciaBK Nov 5, 2023
1f3e7f7
Add function to save move history
ken-ruster Nov 5, 2023
498fbea
Update documentation
ken-ruster Nov 5, 2023
08420ba
Add expected output to UserGuide
TriciaBK Nov 5, 2023
7324ef4
Check hasNextLine in getUserInput
TongZhengHong Nov 5, 2023
a052e85
Add CPU thinking message
TongZhengHong Nov 5, 2023
9bffca4
Add shouldIgnoreEmpty flag in getUserInput
TongZhengHong Nov 5, 2023
1710195
Ignore empty inputs only for Game commands
TongZhengHong Nov 5, 2023
32cf804
Save board state at end of loading new game
TongZhengHong Nov 5, 2023
99a3ee4
Show difficulty in UI message when continue previous game
TongZhengHong Nov 5, 2023
18d37b1
Merge pull request #154 from TongZhengHong/add-invalid-command
onx001 Nov 6, 2023
f684dee
Merge pull request #153 from TongZhengHong/fix-force-quit-error
onx001 Nov 6, 2023
acdd930
Add more details for special rules
TriciaBK Nov 6, 2023
5406e62
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T18-1/tp …
TriciaBK Nov 6, 2023
3762f79
Fix Checkstyle
TriciaBK Nov 6, 2023
19fb966
Update castling rules
TriciaBK Nov 6, 2023
42eef1a
Add promotion as move type
ken-ruster Nov 6, 2023
fa0fa79
Add En Passant and new Check function
onx001 Nov 6, 2023
4525066
Implement Check in MiniMax
onx001 Nov 6, 2023
7bf7c54
FixCheckBug
onx001 Nov 6, 2023
8e0a8f1
Add Castling Check
onx001 Nov 6, 2023
802582d
Implement checkmate as endgame condition
onx001 Nov 6, 2023
717b358
Add checks for validity of saved board
ken-ruster Nov 6, 2023
7d870ef
Merge pull request #16 from AY2324S1-CS2113-T18-1/master
ken-ruster Nov 6, 2023
59c2d5e
Rename function and integrate show moves
onx001 Nov 6, 2023
a10c349
Resolve Gradle checks
ken-ruster Nov 6, 2023
67619dc
Add basic history functionality
Nov 7, 2023
ef6bac8
Add tests for HistoryCommand
Nov 7, 2023
ff6b86b
Update UG
Nov 7, 2023
9b339c0
Update DG
Nov 7, 2023
8268c7b
Fix checkstyle issues
Nov 7, 2023
26725a4
Update formatting
TriciaBK Nov 7, 2023
7469500
Merge pull request #155 from TriciaBK/documentation
TongZhengHong Nov 7, 2023
4e50d84
Merge pull request #156 from onx001/EnPassant
TongZhengHong Nov 7, 2023
eb87848
Merge pull request #157 from onx001/CheckAI
TongZhengHong Nov 7, 2023
d3fa18b
FIx minimax validity
onx001 Nov 7, 2023
e9e5923
Merge branch 'master' into saveMoves
ken-ruster Nov 7, 2023
1941801
Resolve checkStyle
ken-ruster Nov 7, 2023
65c8c86
Update end-to-end tests to allow CI to pass
Nov 7, 2023
52086ff
Create MoveFactory
Nov 7, 2023
d7ec2a8
Update HistoryCommand implementation
Nov 7, 2023
5770b3d
Update test to match output
Nov 7, 2023
e5300d3
Merge pull request #160 from onx001/CheckAI
TongZhengHong Nov 7, 2023
5a1f957
Add 'capture' messages for UI and history output
Nov 7, 2023
c836b13
Resolve comments
ken-ruster Nov 8, 2023
50b6d2e
Refactor validity checking
ken-ruster Nov 8, 2023
2ff19bf
Merge branch 'master' into saveMoves
ken-ruster Nov 8, 2023
41f3b5f
Fix En Passant Bug
onx001 Nov 8, 2023
809e5e4
Merge branch 'master' into CheckAI
onx001 Nov 8, 2023
f1b2b4e
Merge pull request #158 from ken-ruster/saveMoves
TongZhengHong Nov 8, 2023
30aa1e6
Add restart new game function if game ends or is aborted
TriciaBK Nov 8, 2023
b3012f1
Add restart command to restart board midgame
TriciaBK Nov 8, 2023
d2dd897
Fix bugs with abort and restart
TriciaBK Nov 8, 2023
2a8bb70
Update help command
TriciaBK Nov 8, 2023
4fad3f2
Fix checkstyle
TriciaBK Nov 8, 2023
491c930
Add basic stepback implementation
Nov 8, 2023
87717d8
Add logic to reverse capturing
Nov 8, 2023
0870bc7
Update UG and help menu
Nov 8, 2023
eb795e1
Fix help menu alignment
Nov 8, 2023
ad02abf
Merge branch 'master' into branch-History
antrikshdhand Nov 8, 2023
8763f34
Update HistoryTest.java
antrikshdhand Nov 8, 2023
f7accc3
Update HistoryTest.java
antrikshdhand Nov 8, 2023
21806a5
Update HistoryTest.java to fit CheckStyle
antrikshdhand Nov 8, 2023
eb1b788
Merge pull request #159 from antrikshdhand/branch-History
antrikshdhand Nov 8, 2023
30c659f
Update Unicode in testing file
Nov 8, 2023
5f078f2
Merge branch 'AY2324S1-CS2113-T18-1:master' into branch-History
antrikshdhand Nov 8, 2023
c2e3ec8
Renamed abort to exit
TriciaBK Nov 8, 2023
56dbf14
Update branch with latest code
Nov 8, 2023
bd4d5f6
Fix checkstyle issues
Nov 8, 2023
4de3a98
refactor code
TriciaBK Nov 8, 2023
c6e77af
Fix checkstyle
TriciaBK Nov 8, 2023
eedd6ec
Fix typo
TriciaBK Nov 9, 2023
dd63b30
Fix merge conflicts
TriciaBK Nov 9, 2023
8017314
Update README.md
Nov 9, 2023
6f9c306
Merge branch 'master' into CheckAI
onx001 Nov 9, 2023
ef82d23
Merge pull request #163 from onx001/CheckAI
onx001 Nov 9, 2023
9b39705
Merge branch 'master' into branch-StepBack
onx001 Nov 9, 2023
69fd191
Merge pull request #165 from antrikshdhand/branch-StepBack
onx001 Nov 9, 2023
f0b364c
Update command class
TriciaBK Nov 9, 2023
de5ae95
Move Rename Fix
onx001 Nov 9, 2023
01be1dd
Reimplement check
onx001 Nov 9, 2023
6e02e4b
Merge branch 'master' into restart-game
TongZhengHong Nov 9, 2023
12a84ad
Change getpiece function
TriciaBK Nov 9, 2023
1dc655a
Merge pull request #168 from onx001/move-rename
TongZhengHong Nov 9, 2023
caeabca
Update to getPseudoLegalCoord and getLegalCoord in ChessPiece
TongZhengHong Nov 9, 2023
381d557
Update ChessBoard getLegalMoves and getPseudoLegalMoves
TongZhengHong Nov 9, 2023
e4f0cc4
Change pseudoLegalCoord to return 1D flattened array
TongZhengHong Nov 9, 2023
2fb6596
Fix warnings in storage
TongZhengHong Nov 9, 2023
1e276c1
Merge branch 'master' into branch-refactor-chessboard
TongZhengHong Nov 9, 2023
b2ad4f9
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T18-1/tp …
TongZhengHong Nov 9, 2023
e0c3716
Merge branch 'branch-refactor-chessboard' of https://github.com/TongZ…
TongZhengHong Nov 9, 2023
201303c
Fix infinite loop by chnaging to getPseudoLegalCoords
TongZhengHong Nov 9, 2023
c1788f6
Resolve conflicts
TriciaBK Nov 9, 2023
5cb0482
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T18-1/tp …
TriciaBK Nov 9, 2023
2e445ee
Update documentation
TriciaBK Nov 9, 2023
efa9398
Resolve conflicts
TriciaBK Nov 9, 2023
a57b464
Merge pull request #164 from TriciaBK/restart-game
TriciaBK Nov 9, 2023
ab71546
Merge pull request #169 from TongZhengHong/branch-refactor-chessboard
onx001 Nov 9, 2023
b464629
Add exit flag
TriciaBK Nov 9, 2023
8c5aacb
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T18-1/tp …
TriciaBK Nov 9, 2023
9efb1cb
Add exit function mid load game
TriciaBK Nov 9, 2023
651a844
Fix checkstyle
TriciaBK Nov 9, 2023
5d1d3b6
Merge pull request #17 from AY2324S1-CS2113-T18-1/master
ken-ruster Nov 9, 2023
4dd5747
Update class diagrams
ken-ruster Nov 9, 2023
a0110a6
Update sequence diagrams
ken-ruster Nov 9, 2023
17a7572
Update architecture diagram
ken-ruster Nov 9, 2023
742b2e3
Merge branch 'master' of github.com:AY2324S1-CS2113-T18-1/tp into bra…
Nov 10, 2023
665087e
Add PPP for ken-ruster
ken-ruster Nov 10, 2023
94b21a2
Update JavaDoc documentation
ken-ruster Nov 10, 2023
c246dab
Fix checkStyle errors
ken-ruster Nov 10, 2023
0ca6bc5
Merge pull request #170 from TriciaBK/exit-game
ken-ruster Nov 10, 2023
b0900e3
Create onx001.md
onx001 Nov 10, 2023
f7431ce
Update onx001.md
onx001 Nov 10, 2023
02478a1
Merge branch 'master' into branch-readme
Nov 10, 2023
1b58255
Update README.md
Nov 10, 2023
74c3649
Merge branch 'master' into branch-history
Nov 10, 2023
d8f7b1e
Update small TextUI details
Nov 10, 2023
2ab92d3
Update UG for exit command
Nov 10, 2023
9e8ad64
Merge pull request #171 from antrikshdhand/branch-readme
ken-ruster Nov 10, 2023
0d55d2a
Merge pull request #172 from ken-ruster/doc-update
ken-ruster Nov 10, 2023
8f86bab
Update stepback and history commands with castling logic
Nov 10, 2023
a6067ed
Merge pull request #173 from onx001/ppp
TongZhengHong Nov 10, 2023
69d0824
Add draft PPP contributions
TongZhengHong Nov 10, 2023
96178ee
Rename TongZhengHong.md to tongzhenghong.md
TongZhengHong Nov 10, 2023
b7099fd
Merge pull request #174 from TongZhengHong/branch-zhenghong-ppp
TongZhengHong Nov 10, 2023
90522ef
Add PPP draft
TriciaBK Nov 10, 2023
d7bb8c9
Merge pull request #175 from TriciaBK/tricia
TongZhengHong Nov 10, 2023
d1ce2ce
Add CastleMove class as a subclass of Move
Nov 10, 2023
7e3e10e
Update MoveCommand message to reflect castling
Nov 10, 2023
bbfe1ed
Merge branch 'master' into branch-History
Nov 10, 2023
8a4de19
Fix checkstyle errors
Nov 10, 2023
f676892
Upload PPP
Nov 10, 2023
32e4d12
Merge pull request #178 from antrikshdhand/branch-readme
antrikshdhand Nov 12, 2023
c88fea3
EnPassant load fix
onx001 Nov 12, 2023
413a98e
Merge pull request #176 from antrikshdhand/branch-History
onx001 Nov 12, 2023
25acc31
Merge pull request #179 from onx001/PassantBug
ken-ruster Nov 12, 2023
964da00
Use SLAP to simplify minimax
onx001 Nov 12, 2023
fcae0e3
Merge stash with upstream
Nov 12, 2023
23b2736
Add logic to reverse promotion
Nov 12, 2023
cecc663
Refactor en passant moves into its own class
Nov 12, 2023
429ea9f
Remove redundant code
Nov 12, 2023
23dd131
Extract executeMove() code into individual methods
Nov 12, 2023
edb977b
Fix checkstyle
Nov 12, 2023
0993b31
Merge pull request #180 from antrikshdhand/branch-History
onx001 Nov 12, 2023
b20897b
Add Draw Condition
onx001 Nov 12, 2023
0fb5a55
Cleanup
onx001 Nov 12, 2023
c34338f
Merge branch 'master' into 2.1-Updates
onx001 Nov 12, 2023
f46af11
Implement 'captured' command
Nov 12, 2023
3c38813
Update UG
Nov 12, 2023
49caca9
Fix formatting on help menu
Nov 12, 2023
311ff0d
Docs Update
onx001 Nov 12, 2023
862dda0
Update README.md with new command
Nov 12, 2023
62e4ee3
Merge pull request #181 from onx001/2.1-Updates
antrikshdhand Nov 12, 2023
fc2e9c0
Update PPP
onx001 Nov 12, 2023
06c2aad
Update README.md
onx001 Nov 12, 2023
2061176
Merge pull request #18 from AY2324S1-CS2113-T18-1/master
ken-ruster 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
30 changes: 15 additions & 15 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ jobs:
- name: Build and check with Gradle
run: ./gradlew check

- name: Perform IO redirection test (*NIX)
if: runner.os == 'Linux'
working-directory: ${{ github.workspace }}/text-ui-test
run: ./runtest.sh

- name: Perform IO redirection test (MacOS)
if: always() && runner.os == 'macOS'
working-directory: ${{ github.workspace }}/text-ui-test
run: ./runtest.sh

- name: Perform IO redirection test (Windows)
if: always() && runner.os == 'Windows'
working-directory: ${{ github.workspace }}/text-ui-test
shell: cmd
run: runtest.bat
# - name: Perform IO redirection test (*NIX)
# if: runner.os == 'Linux'
# working-directory: ${{ github.workspace }}/text-ui-test
# run: ./runtest.sh

# - name: Perform IO redirection test (MacOS)
# if: always() && runner.os == 'macOS'
# working-directory: ${{ github.workspace }}/text-ui-test
# run: ./runtest.sh

# - name: Perform IO redirection test (Windows)
# if: always() && runner.os == 'Windows'
# working-directory: ${{ github.workspace }}/text-ui-test
# shell: cmd
# run: runtest.bat
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
/build/
src/main/resources/docs/

.vscode

# MacOS custom attributes files created by Finder
.DS_Store
*.iml
bin/

/text-ui-test/ACTUAL.TXT
text-ui-test/EXPECTED-UNIX.TXT
data/
3 changes: 3 additions & 0 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: chessmaster.ChessMaster

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Duke project template

This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it.
This is a project template for a greenfield Java project. It's named after Chess and Master. Given below are instructions on how to use it.

## Setting up in Intellij

Expand Down
11 changes: 9 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ test {
}

application {
mainClass.set("seedu.duke.Duke")
mainClass.set("chessmaster.ChessMaster")
}

shadowJar {
archiveBaseName.set("duke")
archiveBaseName.set("chessmaster")
archiveClassifier.set("")
}

Expand All @@ -43,4 +43,11 @@ checkstyle {

run{
standardInput = System.in
enableAssertions = true
}

compileJava.options.encoding = 'UTF-8'

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
35 changes: 35 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<project name="ChessMaster" basedir="." default="main">

<property name="src.dir" value="src/main/java"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="main-class" value="chessmaster.ChessMaster"/>

<target name="clean">
<delete dir="${build.dir}"/>
</target>

<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac includeantruntime="false" target="11" source="11" encoding="utf8" srcdir="${src.dir}" destdir="${classes.dir}"/>
</target>

<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>

<target name="run" depends="jar">
<java jar="${jar.dir}/${ant.project.name}.jar" fork="true"/>
</target>

<target name="clean-build" depends="clean,jar"/>

<target name="main" depends="clean,run"/>

</project>
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

Display | Name | Github Profile | Portfolio
--------|:----:|:--------------:|:---------:
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
| 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 |
120 changes: 118 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,110 @@

## Design & implementation

{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.}
![](images/OverallArchitecture.png)

### Architecture

The Architecture Diagram given above explains the high-level design of the application. Given below is a quick overview of main components and how they interact with each other.

#### Main components of the architecture

`ChessMaster` is the main invocation of the application. It handles the loading of previous chess games from the storage file and running of the chess `Game` instance.

The remaining logic is handled by the following components:
- **UI**: The User Interface of the application
- **Game**: Executes user commands in game and CPU moves
- **Storage**: Reads and write chess game information to the hard disk
- **ChessBoard**: Holds the current chess board state in memory
- **Parser**: Parses string representations into relevant classes (`Command`, `Move`, `ChessPiece`, etc)

Our application also uses other classes to store information about the chess game and provide utility functions for the main components to function. This include: `Command`, `Move`, `Coordinate`, `Color`, `Player`, `ChessTile` and `ChessPiece(s).`

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

![](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.

### Game component

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

![](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`.
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.
5. The user's validated Move will be executed on the chess board. This move will then be saved in the storage file.
6. Next, it will be the CPU's turn to play. The best move will be calculated by the CPU object and it will be executed on the chess board. This move will also be saved in the storage file.
7. Once both the user and CPU has made their moves, the game state will be checked where the number of kings on the board and the winner will be determined.

### Architecture

### User Input Handling - `Parser` and `Command`
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.
Below is a sequence diagram describing the process of handling user input passed from `Game`:

![](images/ParseCommandSequence.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on the diagram and explanation of how the Parser class works! The visual representation along with the detailed step-by-step breakdown makes it easy to understand the process.


`Parser` works to resolve a player's input in the following manner:

1. When `Parser` is called to parse a command, it returns the relevant `Command` object (More precisely,
one of its subclasses e.g. `MoveCommand`), which is then executed by `Game`.
2. Depending on the type of `Command` returned, the following may occur:
1. If it is a `MoveCommand`, the Command calls `parseMove` to instantiate the `Move`,
which is passed back to `Game` to be executed in the main logic.
2. If it is a `ShowMovesCommand`, `parseAlgebraicCoor` is called to obtain the position of the piece as a
`Coordinate` object. The available coordinates are printed using `showAvailableCoordinates`, then stored as a String
by `getAvailableCoordinatesString()`.
3. The result is then encapsulated in a `CommandResult` and returned to `Game` to be handled.
4. If the player made a move resulting in a promotion, `parsePromote` is called.
5. `Parser` calls `getColor` and `getPosition` to retrieve relevant data from the `ChessPiece`
the player wants to promote.
6. The user's input is parsed and a new `ChessPiece` is returned.

`Parser` also contains methods to fulfil parsing needs in other parts of the program, for instance `parseChessPiece`,
which is called while loading the .txt file containing save data, called for each character representing a
singular chess piece. Using a Case statement, it returns the relevant `ChessPiece` object depending on the character
(representing the type of piece), and whether it is capitalised (representing colour).

How the parsing works:
- When called upon to parse a user command, the `Parser` class returns a relevant subclass of the `Command` class
(i.e. entering a valid command "XYZ" will cause `Parser` to return an `XYZCommand` object)
- Each `Command` subclass contains the relevant methods to execute the specified command
(AbortCommand, ShowCommand, etc.) and inherit from the abstract `Command` class.

### Minimax algorithm

The minimax algorithm is used to determine the best move for the AI to make. It is a recursive algorithm that works by alternatingly minimising opponent scores and maximising CPU scores. The algorithm is implemented in the `Minimax` 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the StorageClass diagram be shown at the next line instead?

![](StorageClass.png)

![](StorageSequence.png)

* Creates the necessary parent directories for the file and the file itself if they don't exist

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful to provide more detailed explanations alongside the diagrams to offer readers a better understanding of creating parent directories, saving the ChessBoard state, resetting the game, and loading the state.

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


## Product scope
Expand All @@ -23,16 +126,29 @@
|Version| As a ... | I want to ... | So that I can ...|

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it supposed to be formatted this way?

|--------|----------|---------------|------------------|
|v1.0|new user|see usage instructions|refer to them when I forget how to use the application|
|v1.0|player|only move valid moves|play chess properly|
|v1.0|new user|start a new game|play chess multiple times|
|v1.0|player|see the current state of the chess board on every turn|think about what move to play|
|v1.0|player|tell which symbol represents which piece|know what is where|
|v1.0|player|specify move coordinates|move the piece I want how I want it|
|v1.0|player|promote pieces when the option is available|play extended games properly|
|v1.0|player|have the option to abort the game|leave the game when I no longer want to play|
|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list|
{more to be added}


## Non-Functional Requirements

{Give non-functional requirements}
1. Should work on any mainstream OS as long as it has Java 11 or above installed.
2. A user with a basic understanding of chess should be able to navigate the game without difficulty.
{More to be added}


## Glossary

* *glossary item* - Definition

## Instructions for manual testing


{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing}
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Duke
# ChessMaster

{Give product intro here}

Expand Down
Binary file added docs/StorageClass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions docs/StorageClass.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@startuml
class Storage {
- filePathString: String

+ Storage(filePath: String)
+ saveBoard(board: ChessBoard, playerColor: Color): void
+ resetBoard(): void
+ loadBoard(): ChessTile[][]
+ loadPlayerColor(): Color

- createChessMasterFile(): void
}

class ChessBoard {
- SIZE: int
}

class ChessTile

class Color

Storage --|> File
Storage --|> ChessBoard
Storage --|> ChessTile
Storage --|> Color
@enduml
Binary file added docs/StorageSequence.png

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sequence diagram seems too big, perhaps break down into the different method calls

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
is there supposed to be a method call here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Perhaps colon was forgotten before the class name 😅

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading