Skip to content

An Online/Offline playable Chess game with a smart AI on Qt5. It is wrote by C++.

Notifications You must be signed in to change notification settings

adsf0427/Cute_Chess-Online_and_AI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smart_Chess

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

How to play online:

Alt text


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: Alt text

Here is an example of what happen when one side wins in one game:

Alt text

How this AI is:

Alt text

I am not even its opponent!!!

The AI can play both of white side and black side:

Alt text

It was a simple version and looks very stupid: Alt text Alt text

This program can also play as PVP:

Alt text

Of course, it can do Promotion and Castling. Alt text

Alt text

Bugs:

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!

About

An Online/Offline playable Chess game with a smart AI on Qt5. It is wrote by C++.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 63.8%
  • C 34.2%
  • QMake 2.0%