A Chess which is built by Qt and C++.
It can be played online by creating games in the lobby, and the server will show all games in the lobby for all clients.
It can also be played offline with two modes: 1: play with another human player; 2: play with a very SMART AI.
The AI uses the MiniMax algorithm.
Get some idea and information from this tutorial
and https://github.com/subeshb1/Chess
AI's idea from https://github.com/lhartikk/simple-chess-ai
You can download and play it from HERE.
ALL code are in folder "Client" and "Server".
VS2017 compiles the server. Qt creator compiles the client(Game).
It uses winsock and windows.h to write the online part. So it cannot be run in Linux now. There will be a Linux version in the future.
It uses cJSON to serialize messages like the move, create games, games list, etc.
It's a TCP connection to make sure it can receive and send the message successfully.
Here is another GIF how this game is played online:
Here is an example of what happen when one side wins in one game:
I am not even its opponent!!!
The AI can play both of white side and black side:
It was a simple version and looks very stupid:
This program can also play as PVP:
Of course, it can do Promotion and Castling.
It still has many bugs in the server. Sometimes it cannot send messages to clients.
It has a bug in AI when the AI only has two possible turns left.
If you find where these bugs is in my code, I will be very appreciated for your help! And if you have any ideas which can help me improve this game, please tell me!