This is the second phase of my advanced programming class of the second semester of 2021-2022 academic year. A 'smart chess' application was needed to be written with the following functionalities:
- The ability to play chess on the with the ordinary logics of chess.
- The app must be able to report 'dangerous` moves to the player. These are the moves which allow the opponent to win the game in the next one/two moves.
- The app also must be able to report the best attacks. These are the moves which enable the player to mate his opponent in the next one/two moves.
- The app must be able to receive an chess board(in a certain text template) and provide all the above functionalities to the user.
- A graphical user interface must be designed using the SFML library in order to let the user play the game in a graphical environment.
Here is an screenshot from the application:
In the above-demonstrated situation, white is possibly in a mate-in-one posiiton. However, the black has analyzed all the moves for the knight located in F8. The program suggests that out of the two possible moves for this piece, one of them enables the white to win the game in one move but one of them is not particularly dangerous. The dangerous move is marked with the alert icon.
Simply clone this repository, switch directory to the root folder of the project and run g++ src/Main.cpp && ./a
. Please note that you must have SFML installed in advance, it can be painlessly installed on most of the GNU/Linux distors by sudo apt install sfml
.