|
@ -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) { |
|
|
char checkLine(char a, char b, char c) { |
|
|
if (a == b && b == c) return a; |
|
|
if (a == b && b == c) return a; |
|
|
return ' '; |
|
|
return ' '; |
|
@ -97,12 +104,6 @@ int isGameOver() { |
|
|
return (winner == PLAYER_X || winner == PLAYER_O || isBoardFull()); |
|
|
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) { |
|
|
void printGameResult(char winner) { |
|
|
if (winner == PLAYER_X || winner == PLAYER_O) { |
|
|
if (winner == PLAYER_X || winner == PLAYER_O) { |
|
|