fork download
  1. #include <stdio.h>
  2.  
  3. #define SIZE 8
  4. #define PLAYERS 4
  5.  
  6. typedef struct
  7. {
  8. char piece; // K,Q,R,B,N,P
  9. int player; // 0 = empty, 1-4 = players
  10. } Cell;
  11.  
  12. Cell board[SIZE][SIZE];
  13.  
  14. int current_player = 1;
  15. int player_alive[PLAYERS + 1];
  16.  
  17. int main(void) {
  18. int i, j;
  19.  
  20. printf("\n");
  21.  
  22. for(i = 0; i < SIZE; i++)
  23. {
  24. printf("%d ", SIZE - i);
  25.  
  26. for(j = 0; j < SIZE; j++)
  27. {
  28. printf("%c ", board[i][j].piece);
  29. }
  30.  
  31. printf("\n");
  32. }
  33.  
  34. printf("\n ");
  35.  
  36. for(j = 0; j < SIZE; j++)
  37. printf("%c ", 'A' + j);
  38.  
  39. printf("\n");
  40. return 0;
  41. }
  42.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
8          
7          
6          
5          
4          
3          
2          
1          

   A B C D E F G H