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 )
/* 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){
longint 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 *
****************************************************************************************/
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