Browse Source

Write printBoard function

main^2
fdai7726 11 months ago
committed by Peter Wiebe
parent
commit
5e9a0502f3
  1. 22
      src/main/c/VierGewinnt.c

22
src/main/c/VierGewinnt.c

@ -104,3 +104,25 @@ void initializeBoard(char board[ROWS][COLS]) {
}
}
}
// Write printBoard function
void printBoard(char board[ROWS][COLS]) {
clearScreen();
printf("\n");
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
printf("| %c ", board[i][j]);
}
printf("|\n");
for (int j = 0; j < COLS; j++) {
printf("----");
}
printf("-\n");
}
printf(" 1 2 3 4 5 6 7\n\n");
}
Loading…
Cancel
Save