|
|
@ -26,6 +26,13 @@ void displayBoard() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int get_move(){ |
|
|
|
int choice; |
|
|
|
printf("Spieler %c, waehle eine Zahl (1-9): ", (currentPlayer == PLAYER_X) ? 'X' : 'O'); |
|
|
|
scanf("%d", &choice); |
|
|
|
return choice; |
|
|
|
} |
|
|
|
|
|
|
|
char checkLine(char a, char b, char c) { |
|
|
|
if (a == b && b == c) return a; |
|
|
|
return ' '; |
|
|
@ -97,12 +104,6 @@ int isGameOver() { |
|
|
|
return (winner == PLAYER_X || winner == PLAYER_O || isBoardFull()); |
|
|
|
} |
|
|
|
|
|
|
|
int get_move(){ |
|
|
|
int choice; |
|
|
|
printf("Spieler %c, waehle eine Zahl (1-9): ", (currentPlayer == PLAYER_X) ? 'X' : 'O'); |
|
|
|
scanf("%d", &choice); |
|
|
|
return choice; |
|
|
|
} |
|
|
|
|
|
|
|
void printGameResult(char winner) { |
|
|
|
if (winner == PLAYER_X || winner == PLAYER_O) { |
|
|
|