Browse Source

41 Text einfärben

main^2
Simon Hildebrandt 11 months ago
committed by Peter Wiebe
parent
commit
11e8af8e1e
  1. 10
      src/main/c/TicTacToe.c

10
src/main/c/TicTacToe.c

@ -25,7 +25,15 @@ void Bild(char Feld[3][3]) {
#endif #endif
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) { for (int j = 0; j < 3; j++) {
printf("%c ", Feld[i][j]);
if (Feld[i][j] == '_') {
printf(ANSI_COLOR_BRIGHT_YELLOW"%c "ANSI_COLOR_RESET, Feld[i][j]);
}
else if (Feld[i][j] == 'X') {
printf(ANSI_COLOR_BRIGHT_CYAN"%c "ANSI_COLOR_RESET, Feld[i][j]);
}
else {
printf(ANSI_COLOR_BRIGHT_RED"%c "ANSI_COLOR_RESET, Feld[i][j]);
}
} }
printf("\n"); printf("\n");
} }

Loading…
Cancel
Save