Chess game In C++ with error handling

hello
this is my first topic and first game in c++ i hope you like it
it a simple chess game but only this time it handles errors
it is not completed yet (in the second part maybe )






download the game from
http://adfoc.us/17042240689459

and the source code from her

1-the chess.ccp
http://adfoc.us/17042240719033


2-the chess-resource.h
http://adfoc.us/17042240707307


this is the code



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* BY THE NAME OF ALLAH THE MERCIFUL THE COMPASSIONATE.
 * Library name: "chess-resource.h" .
 * Author: nacereddine abed elillah.
 * Purpose: play the chess game.
 * Remarque: all rights are reserved to the author and the author will not be responsible for any
         illegal use of this game engine.
 * last time modified: 19/01/14 17:43 */
 
#include "chess-resource.h"

int main (){
    int move_memory[80][8][8];
    int move_number=0; // an increment for move_memory.
    int board[8][8]; // the chess board.
.  
.
.
.
.
.
                                          for (index_i=0;index_i!=140;index_i++){tmp[index_i]=old_moves[index_i];}// putting old_moves in tmp.
                                          for (index_i=0;index_i!=140;index_i++){old_moves[index_i]='\0';} // clear old_moves.
                                          for (index_i=0;index_i!=135;index_i++){old_moves[index_i]=tmp[index_i+5];} 
                                          /*deleting the first move and regrouping the remaining.*/}
                         }}}} 
             }
        system("cls");
               }         }
     return(1);
     }

it contains six functions
1-the welcome function
1
2
3
4
5
6
7
 /***************************************************************
  *                     'welcome()'                             *
  * A function that shows the welcome screen.                   *
  * Parameters: 1) choice: an char represent the user's choice. *
  * Returns: void.                                              *
  ***************************************************************/ 
  

2- the delay function
1
2
3
4
5
6
7
8
9
10
11
/*******************************************************
  *                   'Delay()'                         *
  *  A function that cause a time delay to show the     *
  *                     screen.                         *
  * Parameters: 1)time: an integer to define the delay  *
  *                    time.                            *
  * Return: void.                                       *
  *******************************************************/
  void delay(int time){   
    long int delay=0;
     while(delay<time*100000000){++delay;}}

3-the start_up function
1
2
3
4
5
6
7
8
9
/***************************************************************************************
 *                                   'start_up()'                                      *
 *     A function that puts all the pieces in there start up positions,also initialize *
 *                    the turn integer and the old_moves array                         *
 * Parameters: 1)board: an array to hold the start up positions.                       *
 *             2)old_moves: an array of characters wish holds the last 28 moves.       *
 *             3)turn: an integer that refers to wish player is going to play now.     *
 * Returns: void.                                                                      *
 ***************************************************************************************/


4- the show_screen function
1
2
3
4
5
6
7
8
9
 /****************************************************************************************
  *                                  'show screen()'                                     *
  *                 A function that shows the screen of a chess game.                    *
  * Parameters : 1) board: an array(matrix) of integers containing the board's data.     *
  *              2) old_moves: an array of characters wish holds the last 28 moves.      *
  *              3) turn: an integer that refers to wish player is going to play now.    *
  *              4) error: an integer that refers to wish mistake that has been made.    *
  * Returns: void                                                                        *
  ****************************************************************************************/


Last edited on
Why did you delete this other topic?
http://www.cplusplus.com/forum/beginner/127471/
It still appears for me in search results and I remember reading it.
Last edited on
when i did not receive any replies, i thought that the topic is in the wrong section, that is why i moved it her
also i could not see if anyone actually read the topic

thank you for your reply it is a good feeling to know that someone read the topic
so guys what is your opinion ..........
Last edited on
Topic archived. No new replies allowed.