Chess

This repository includes the C code for the game chess, you can get the code from here but please read the discriptions first.

Discriptions

Before executing the code,since this code was written awile ago, if you are using Visual Studio you have to follow the instruction below in order for the code to work (It will give errors for fopen and other functions that have been edited through the years.)

Under “Project -> Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions” add “ ;_CRT_SECURE_NO_WARNINGS”

We will now explain how to play C-Chess game.

First Menu

At first, when the code is launched, you will have two options.

  1. Load Game
  2. New Game

If you have saved a game before, the name of the file you saved the game with will appear below (you can save up to 5 game). The highscore for the game is also shown in the first menu. The score of each chess piece will be noted down in the score section.

After pressing 2 you will directed to a new game and pressing 1 will ask which saved game you want to load. By typing the name of the saved file you will be able to continue the game.

Second Menu

The second menu is quite self explanatory. The rules that are important is that either teams can start but after that please consider which team’s turn it is. If your piece move is invalid a notification will appear and your turn is over.

By pressing P you can pick up a piece and move it. The pieces are as follows:

The game will only end when either team hits the oppositions king.

Score

The score for hitting each piece is noted below:

The score of the winner team will be printed at the end of the game and you can see the highscores of all the games in the first menu.

Bugs

In the future, I’ll try to fix the minor bugs that the code has and will post updates for it here.

Thank You for your attention.