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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#include <iostream>
using namespace std;
void disp_board();
void player_turn();
void rook(char, int ,int, int, int);
void knight(char, int ,int, int, int);
void bishop(char, int ,int, int, int);
void queen(char, int ,int, int, int);
void king(char, int ,int, int, int);
void pawnw(char, int ,int, int, int);
void pawnb(char, int ,int, int, int);
bool check(char);
bool checkmate();
bool stalemate();
int i=1;
char z=(char)176;
char x;
int row;
int row1;
int column;
int column1;
char turn;
char board[10][10] = {{'/','/','/','/','/','/','/','/','/','/'}, // Main Board
{'/','r','n','b','q','k','b','n','r','/'},
{'/','p','p','p','p','p','p','p','p','/'},
{'/',' ',' ',' ',' ',' ',' ',' ',' ','/'},
{'/',' ',' ',' ',' ',' ',' ',' ',' ','/'},
{'/',' ',' ',' ',' ',' ',' ',' ',' ','/'},
{'/',' ',' ',' ',' ',' ',' ',' ',' ','/'},
{'/','P','P','P','P','P','P','P','P','/'},
{'/','R','N','B','Q','K','B','N','R','/'},
{'/','/','/','/','/','/','/','/','/','/'}};
char extra[2][2] = {{' ',' '}, // Used For Checking Castling
{' ',' '}};
char pawn[2][8] = {{' ',' ',' ',' ',' ',' ',' ',' '}, // Used For Checking En Passant
{' ',' ',' ',' ',' ',' ',' ',' '}};
int main() // Main Program
{
turn='X';
while(i>0) // Executes Game
{
cout<<"Chess"<<endl;
disp_board(); // Displays Board
player_turn(); // Executes Player Turn
system("cls"); // Clears Screen After 1 Turn
}
system("pause");
}
|