fork download
  1. #include <stdio.h>
  2. #include "checkers.h"
  3.  
  4. int the_board [BOARD_SIZE][BOARD_SIZE]=
  5. {
  6. {0,1,0,1,0,1,0,1},
  7. {1,0,1,0,1,0,1,0},
  8. {0,1,0,1,0,1,0,1},
  9. {0,0,3,0,3,0,3,0},
  10. {0,0,0,0,0,0,0,0},
  11. {2,0,4,0,4,0,2,0},
  12. {0,2,0,2,0,2,0,2},
  13. {2,0,2,0,2,0,2,0}
  14. };
  15.  
  16. int main()
  17. {
  18. int i,j;
  19. currentPlayer = whiteTurn;
  20. print_board();
  21.  
  22. do{
  23. start:
  24. printPlayer();
  25. scanf("%d %d %d %d", &x_from, &y_from, &x_to, &y_to);
  26. if (check_move(currentPlayer,x_from, y_from, x_to, y_to,1) != VALID_MOVE){
  27. printf("INVALID MOVE\n");
  28. goto start;
  29. }
  30. move_piece(currentPlayer,x_from, y_from, x_to, y_to,0);
  31. print_board();
  32. changePlayer();
  33.  
  34. }while ((x_from != 0) || (y_from != 0) || (x_to != 0) || (y_to !=0 ));
  35.  
  36. }
  37.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:22: error: checkers.h: No such file or directory
prog.cpp:4: error: ‘BOARD_SIZE’ was not declared in this scope
prog.cpp:4: error: ‘BOARD_SIZE’ was not declared in this scope
prog.cpp: In function ‘int main()’:
prog.cpp:19: error: ‘currentPlayer’ was not declared in this scope
prog.cpp:19: error: ‘whiteTurn’ was not declared in this scope
prog.cpp:20: error: ‘print_board’ was not declared in this scope
prog.cpp:24: error: ‘printPlayer’ was not declared in this scope
prog.cpp:25: error: ‘x_from’ was not declared in this scope
prog.cpp:25: error: ‘y_from’ was not declared in this scope
prog.cpp:25: error: ‘x_to’ was not declared in this scope
prog.cpp:25: error: ‘y_to’ was not declared in this scope
prog.cpp:26: error: ‘check_move’ was not declared in this scope
prog.cpp:26: error: ‘VALID_MOVE’ was not declared in this scope
prog.cpp:30: error: ‘move_piece’ was not declared in this scope
prog.cpp:32: error: ‘changePlayer’ was not declared in this scope
prog.cpp:34: error: ‘x_from’ was not declared in this scope
prog.cpp:34: error: ‘y_from’ was not declared in this scope
prog.cpp:34: error: ‘x_to’ was not declared in this scope
prog.cpp:34: error: ‘y_to’ was not declared in this scope
prog.cpp:18: warning: unused variable ‘i’
prog.cpp:18: warning: unused variable ‘j’
stdout
Standard output is empty