Advertisement
Seif45

Untitled

Dec 7th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. void swapElements (int swap[]){
  2. pieces[swap[1]][swap[0]]=pieces[swap[1]][swap[0]]^pieces[swap[3]][swap[2]];
  3. pieces[swap[3]][swap[2]]=pieces[swap[3]][swap[2]]^pieces[swap[1]][swap[0]];
  4. pieces[swap[1]][swap[0]]=pieces[swap[1]][swap[0]]^pieces[swap[3]][swap[2]];
  5. }
  6.  
  7. int main()
  8. {
  9. char pieces[12][12];
  10. char gameBoard [12][12];
  11. int i,j;
  12. startingChessBoard();
  13. gameBoardBorders();
  14. checkerBoard();
  15. printGame();
  16. char play[5];
  17. int swap[5];
  18. char temp;
  19. while (1){
  20. printf("Player1 : ");
  21. scanf("%s",play);
  22. swap[0]=play[0]-63;
  23. swap[1]=58-play[1];
  24. swap[2]=play[2]-63;
  25. swap[3]=58-play[3];
  26. swapElements(swap);
  27. printGame();
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement