|
@ -4,3 +4,16 @@ char board[3][3] = {{'1', '2', '3'}, |
|
|
{'4', '5', '6'}, |
|
|
{'4', '5', '6'}, |
|
|
{'7', '8', '9'}}; |
|
|
{'7', '8', '9'}}; |
|
|
char currentPlayer = 'X'; |
|
|
char currentPlayer = 'X'; |
|
|
|
|
|
|
|
|
|
|
|
// Funktionen zur Anzeige des Spielbretts |
|
|
|
|
|
void displayBoard() { |
|
|
|
|
|
printf("Tic-Tac-Toe\n"); |
|
|
|
|
|
for (int i = 0; i < 3; i++) { |
|
|
|
|
|
for (int j = 0; j < 3; j++) { |
|
|
|
|
|
printf("%c", board[i][j]); |
|
|
|
|
|
if (j < 2) printf(" | "); |
|
|
|
|
|
} |
|
|
|
|
|
printf("\n"); |
|
|
|
|
|
if (i < 2) printf("---------\n"); |
|
|
|
|
|
} |
|
|
|
|
|
} |