A five chess game which support PVP&PVE mode. It is a project of UCAS C++ course.
The PVE mode use decision tree to play the chess. In order to have a deeper tree, I use alpha-beta pruning algorithm to prune the tree.
How to build a decision tree you can see this blog.
The structure of this project just like the flowing class diagram shows.
This project use cmake to build, you should first install cmake.
mkdir build
cd build
cmake ..
make
chmod +x ./bin/fivechess
./bin/fivechess
# The UI works well with font SONG(宋).
If you want to change the parameters, this is a table to record all the parameters.
Name | Default Value | Note |
---|---|---|
TOTAL_MATCH | 5 | How many matches of a game? |
BOARD_SIZE | 15 | The size of the chess board |
MAX_DEPTH | 3 | The depth of decision tree. The program works much better when the depth is 4, but it will take more time. |
Maybe I will change this project to a web server to play five chess online.