Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void swapElements (int swap[]){
- pieces[swap[1]][swap[0]]=pieces[swap[1]][swap[0]]^pieces[swap[3]][swap[2]];
- pieces[swap[3]][swap[2]]=pieces[swap[3]][swap[2]]^pieces[swap[1]][swap[0]];
- pieces[swap[1]][swap[0]]=pieces[swap[1]][swap[0]]^pieces[swap[3]][swap[2]];
- }
- int main()
- {
- char pieces[12][12];
- char gameBoard [12][12];
- int i,j;
- startingChessBoard();
- gameBoardBorders();
- checkerBoard();
- printGame();
- char play[5];
- int swap[5];
- char temp;
- while (1){
- printf("Player1 : ");
- scanf("%s",play);
- swap[0]=play[0]-63;
- swap[1]=58-play[1];
- swap[2]=play[2]-63;
- swap[3]=58-play[3];
- swapElements(swap);
- printGame();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement